Show HN: FSSB – A filesystem sandbox for Linux
github.com
github.com
$ cat > nope.c <<EOF
> #include <stdio.h>
> void main() {
> write(creat("nope.nope"), "oh no\n", 6);
> }
> EOF
$ make nope
$ ./fssb -- ./nope
fssb: child exited with 4
fssb: sandbox directory: /tmp/fssb-2/
$ cat nope.nope
oh noEdit: done!
FWIW, I agree with the other comment - blacklists might not be the best solution here.
I don't think sandboxing is an appropriate solutionto this. Especially just filesystem sandboxing. This does nothing to prevent security exploits via any means.
Also how does this compare to chroot?
chroot is completely different because it completely isolates a process from the rest of the filesystem. This is more like, well, a sandbox or overlay.
[1] https://wiki.archlinux.org/index.php/Systemd-nspawn#Use_Btrf...
It appears to intercept a fixed list of syscalls, so it may not be intercepting all of them that are relevant. I don't think, for example, it's intercepting truncate(), so a process sandboxed in this way could still wreak a little havoc.
Like other posters in that thread I am very skeptical that this approach can be made secure and running with acceptable performance (given there are other more practical approaches to restrict processes available (namespaces, seccomp, SELinux...).
- Linux containers on a read only FS
- weaker specialised version of seccomp
- some similar preload intercept as in e.g. Gentoo sandbox (insecure, used more to catch mistakes)
- Ptrace syscall hijack (Ptrace itself is notoriously insecure)
Neither is particularly impressive. You also get support by one random guy on the Internet.
Use a real virtual machine instead please.
Not really - the child program could realize that it's on a read-only FS. But with FSSB, this is actually hidden - the program thinks it's on a regular FS (although I've recently learned that there are more advanced ways to even break this).
>some similar preload intercept
This is slightly more performant (of course, not as fast as a program without ptrace intercepts).
>Use a real virtual machine instead please
This is obviously not a full-fledged security suite ;) Just a simple, lightweight sandbox. Also this is in alpha.
Clearly I need to wake up.