-
Notifications
You must be signed in to change notification settings - Fork 471
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
We want to start running all containers by default with /dev/fuse. #362
Comments
It sounds like this change was already merged in cri-o/cri-o#3822 My feeling on this though is that changes to the default container "attack surface" and available APIs needs a bit more of a formal process. I think it would be worth making this a full enhancement. |
So this is the equivalent of |
Yes. |
that PR was closed, not merged, because we've been squabbling on the approach 😃 |
Ah right, ok. So basically I think some squabbling on this is warranted because while I'd agree it's probably mostly safe it's still a notable change. (For example, if we turn this on by default it becomes another thing different from e.g. upstream Kubernetes + Docker) |
We can not be locked into Docker forever. Docker made some choices that were not correct, and we need to be able to evolve. Google is not using what Docker did, they are using gvisor containers. Amazon is using Firecracker, Alibaba is using Kata. We need to be able to evolve past what Docker decided 7 years ago. The important thing is that the OCI images stored at container registries are able to run, that we are able to pass all of the Kubernetets test suites. If we are able to handle additional workloads that Kubernetes upstream can not, that is not a bad thing. |
Totally agree! Again I'm not saying we should block on anything, just we should have at least some slightly formal process before we expose new APIs/attack surfaces to containers by default. |
@haircommander Could you reopen your PR. We now have the issue with OpenShift. |
it is not clear we've figured out the best route. the options are:
to me, the second option seems most transparent, as well as idiomatic |
I am fine with 2 or 3 |
@runcom WDYT? |
I'm a bit late to this party, but just wondering if we could just have containers that need |
But maybe that's not desired because it would require the user to specify they wanted that and it we want it to just be there by default? |
yeah a user can already ask to have /dev/fuse bind mounted into the container. The currently proposed approach is we're mixing a user namespace capable RuntimeClass with the needs of a builder pod. We'll be gating the user namespace annotations to a specific RuntimeClass (so it can be gated by scc easily). We can give that RuntimeClass /dev/fuse unconditionally, which will allow builder pods to use it. That won't give it to every pod, but theoretically most of the pods that need it |
Interesting, @haircommander. How does that work? I spent a fairly long time trying to get exactly that working on OCP this summer, and had to settle for VFS in my (non-privileged) pods. The saga is here: containers/podman#6667 I would super appreciate it, if you could be very specific, so I (n00b-level) can understand it :) Cheers! |
... it turns out I may have spoken without fully understanding. it was my impression that one could ask /dev/fuse to be mounted into the container and it would all magically work, but I've never actually done it (thus I am on the n00b-level 😄 ). I think my impression came from @rhatdan's comment above describing how a user can pass |
@jskovjyskebankdk - were you able to get I do think if I get proper |
@dustymabe I tried, but it did not work. I think I recall @rhatdan commenting in some other issues, that /dev/fuse should not be mounted into the container, but created. |
Yes from an SELinux point of view adding /dev/fuse via the spec file gets it labeled correctly, volume mounting it in gives it the hosts label. Also works better with User Namespace. |
I can now use /dev/fuse in a pod, running privileged. Not sure if it is because we now run 4.4, or because I made a mistake the last time I tried this. I tried running a privileged pod while dropping capabilitiies SYS_ADMIN and others. But it does not seem to matter when running privileged. (maybe because that ultimately means running as the host's user id 0?) @rhatdan can you think of a way for the admins hosting our OCP instance to tweak the (host) SELinux prefs, so that Pods on OCP can use a hostmounted /dev/fuse? Without running privileged that is. We switch to a new 4.6 cluster next week or so, if that makes a difference in any way. |
@jskovjyskebankdk you can add |
Thank you @haircommander ! Looking forward to 4.7, and will probably try this on our current platform. Cheers! |
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
Any update on this? I have a use-case for a custom build-strategy with buildah in shipwright. @adambkaplan could we make this (non-privileged builds) also "work" in shipwright on OpenShift? |
/remove-lifecycle stale |
we have moved to enable this when a pod specifically requests a user namespace: i.e: gated based on runtime class |
I would say this can be closed |
@haircommander sorry to reach out from a closed issue. But the OCP enhancement you linked seems to be stale. At least it did not make it in time for OCP 4.7. Is there a way to make per-Pod /dev/fuse mounts in OCP 4.7 (which we run now)? Thanks! |
You'd want to use the
to /etc/crio/crio.conf.d you can specify the runtime class as fuse, and add an annotation: which will instruct cri-o to add it as a device |
Thanks! Will it take care of the SELinux labelling? |
I believe so, though I haven't personally checked |
I am leaving this for posterity in the event someone is trying to test this and would like a reference:
If it is necessary to call
|
This would allow us to more easily run fuse-overlay as well as other user file systems if the container is running in a user namespace. We have lots of user attempting to run buildah within a container, and this would enable it.
I plan on adding "/dev/fuse" to cri-o.conf in the installation and having the OS automatically load the fuse kernel module.
I don't see this as much of a security risk, since /dev/fuse is already allowed to be used with no capabilties/privileges by non root users.
The text was updated successfully, but these errors were encountered: