-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential ways to get around networking sandbox #32
Comments
Thanks for reaching out! The current seccomp network filters on Linux certainly could use some love. Initially I was hoping that landlock-based network filters would be available sooner, but since this will probably take a while longer (especially until the kernels are propagated through various distros), I think it makes sense to put some effort into a robust seccomp network filter. The best path forward is likely to rewrite the seccomp code to use a whitelist rather than a blacklist. This is mandatory for secure forward-compatibility and will also likely help with syscalls that get missed accidentally. In this change, the Repurposing existing sockets is probably the more difficult issue to solve, mainly since I'm not entirely sure if this is a bug or a feature. Especially with seccomp there's numerous examples that recommend acquiring "allowed" file descriptors first and then locking down everything in a sandbox to prevent all new filesystem/network access, while still allowing access to the previously opened ones. So I don't plan on making any concrete changes to accommodate this usecase, but if you have ideas that might work for all of these usecases then I'm always open for suggestions. |
This patch blocks all `io_uring` syscalls when the sandbox does not have full networking permissions. Closes #32.
This patch blocks all `io_uring` syscalls when the sandbox does not have full networking permissions. Closes #32.
@mrcnski Thanks for the issue! If you'd like some Phylum swag as a thanks, shoot me your email ([email protected]) and I'll make it happen! |
This sounds about right and is the safest thing to do. I'm not familiar with how a user would typically use birdcage but io_uring has support for something called They're essentially a way of filtering the possible actions on a io_uring fd, similar to seccomp. |
Yeah, I'm also looking forward to Landlock support for this. It seems like some work is already underway, see here and here, but may not be available for a while yet.
I'm curious how you plan to get the list of allowed syscalls. For us it is a rather tricky problem. :) Not super familiar with Linux myself, but is there really no way to restrict a single application with a simple firewall? 🤔 |
This patch blocks all `io_uring` syscalls when the sandbox does not have full networking permissions. Closes #32.
My plan was to start by looking at Docker's seccomp filter and the syscall table and just go through them by hand. Docker somewhat has a different purpose but it should show which syscalls might not be necessary for things to work.
With elevated permissions you can do some more stuff, but I'm not familiar with any mechanism to self-restrict that would be easier. |
Hello, much appreciate your work! I tried to implement a networking sandbox here inspired by birdcage. However, I was informed that there are at least a couple ways to get around it:
io_uring
(cc @alindima for further details)The text was updated successfully, but these errors were encountered: