Filing this so it's on our radar as a potential project. It's a nice to have, but more suited towards a GSoC/TSoP project than anything else IMO.
FreeBSD has a sandboxing/capabilities framework called capsicum(4) (https://www.freebsd.org/cgi/man.cgi?query=capsicum&sektion=4). It would be good for tor to support this in addition to seccomp2, just so people aren't out of luck on non-Linux systems wrt sandboxing.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
Tor has an existing abstraction layer for accessing seccomp'd syscalls on Linux, using a bunch of functions prefixed with sandbox_.
Is it possible to extend or modify that abstraction layer, rather than adding a separate interface for FreeBSD?
That would make it easier to maintain once it's merged.
The problem is that seccomp2 uses a filtering approach. Essentially, once you've whitelisted the things you want to access, you can call open(2), socket(2), etc. at will and on demand.
Note that the code I've written in the Tor codebase has diverged quite a bit from the PoC. The PoC is ugly code meant to serve as a brain dump and code testing area.
This work is nearing completion for a milestone 1. I've diverged quite a bit from the original PoC. How should I proceed from here in getting the code reviewed and merged upstream?
The only known issue is that when sandbox mode is enabled on FreeBSD/HardenedBSD, transparent proxy mode breaks. I'm researching the breakage. Given that transparent proxy mode is not the primary use case nor is widely used, I feel like the current work can go in (pending code review and adjustments resulting from the review) with an errata patch later on.
I'm going to bring this work up-to-date with the latest master branch. It has a few merge conflicts. @ahf, would you have time to review this work after the merge conflicts are resolved?