-
Notifications
You must be signed in to change notification settings - Fork 35
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
mkcomposefs: add --sandbox flag #358
Conversation
97a23bd
to
43db64e
Compare
@@ -1,10 +1,12 @@ | |||
libcomposefs_dep = declare_dependency(link_with : libcomposefs, include_directories : config_inc) | |||
|
|||
seccomp_dep = dependency('libseccomp', required : true) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like the libcap will also be required, shouldn't it also be a dependency on meson?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes thanks for pointing it out. Fixed now
This commit adds a new --sandbox flag to mkcomposefs, enabling an attempt to isolate the process within a restricted environment. The sandbox limits the process's access to host resources, reducing potential attack surfaces. It is a best-effort attempt and does not guarantee full isolation. Signed-off-by: Giuseppe Scrivano <[email protected]>
43db64e
to
a4ae516
Compare
In the past my concern here is that basically everything invoking composefs is already (or should be) in a position to sandbox it. Especially containers/storage - it's already linked into an entire container runtime infrastructure. Having another low level implementation of setting up seccomp rules and using
|
neither Podman nor c/storage build the seccomp profile (buildah does for
|
I'm suggesting we don't add a hard dependency on any containerization (bwrap/systemd-run/crun/etc) here, but just provide recommendations for how to do it externally. Us trying to do it internally creates a "fuzzy" boundary for what external callers should be doing and what we should be doing. I had a really similar debate with the virtiofsd maintainer (which has a ton of internal sandboxing) but that all started to break down when we wanted to run it inside an unprivileged Kubernetes pod because it wanted to do things like create a userns itself which wasn't allowed, etc. Of course in theory creating a userns is safe...in practice, see threads like https://lwn.net/Articles/978846/
Right but surely we could teach c/storage how to basically run an "internal container" with the rootfs of / (i.e. we use crun for the isolation)? Or perhaps crun would do things we don't want here like having it show up in In the end my opinion here is that we should start at least changing c/storage to create a temporary unprivileged userns for helpers we invoke like |
Alternative to containers#358 which would have put some internal sandboxing. Signed-off-by: Colin Walters <[email protected]>
Alternative to containers#358 which would have put some internal sandboxing. Signed-off-by: Colin Walters <[email protected]>
This commit adds a new --sandbox flag to mkcomposefs, enabling an attempt to isolate the process within a restricted environment. The sandbox limits the process's access to host resources, reducing potential attack surfaces. It is a best-effort attempt and does not guarantee full isolation.