-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Proposal: imageless rootless-cni-infra #8709
Comments
I think rewriting the script in go is a requirement since the cnitool is not available on the host. |
Shouldn't the bind mount be read-only? |
I really like this idea. Use the OS as the container image. I would like to see if we could make this a first class object. |
I will tackle it |
@Luap99 Thanks, I would like to see an open discussion on what this should be? For example. should this just be run a container on /? Should this just be build up the OS Directories on scratch and then volume mount in /usr? Can I run this securely, where we somehow figure out what from the host OS needs to be share and what should be private? Years ago, before Docker containers, I was working on virt-sandbox, which was dividing the Host OS up into multiple containers. Imaging running hundreds of apache containers where /usr and most of /var/www is shared. |
I tried to start small and only mount what I need but I quickly discovered that the amount of dependencies needed is huge. I need to bind mount Mounting So I think the only sustainable method would be to mount the full rootfs in the namespace. The only directories that must be writeable by the container are |
I also believe we need to mask over certain files like /etc/passwd and /etc/shadow (Which should be blocked from the container). There may or may not be other directories that need to be masked. |
I'm assuming that
Ooof, I worry this list of needed masking may be much more extensive. Consider also subscription-manager and Thinking back to the original "dynamic build" idea...would it be possible to have a service startup script which re-creates the / directory tree somewhere, then selectively hard-links in the required binaries (from a predetermined list)? This directory then gets volume-mounted as the container's '/'. This would be easy to test, quick to perform, and guarantee only the "current" and necessary binaries are present. I'm guessing this may be easier/simpler than arranging all the special-file masking...but my understanding could be flawed. |
You should never restart the container. If you do it all attached containers lose network connectivity since the network namespace gets destroyed and as @rhatdan and @mheon can confirm cni is notorious for leaving the ip allocation files around even after a reboot. Using a tmpfs to clean them once the container restarts is the easiest and best solution in my eyes. What is the threat model here? We are in a user namespace. We never have more permission than the original user. Thus we cannot read Next we don't run some untrusted third party app in the container we only run the rootless-cni-infra script which we control. Also the image version did not respect the |
Oh, right, okay, so throwing away the data isn't a concern then since related containers would otherwise break when the network
So if I understand correctly: The only possible exploits inside the CNI infra container (running with privileges) imply a compromised host in some way (requiring superuser or worse). The only vector from the rootless container side, would be through the shared network namespace, which (presumably) has a minuscule surface-area. Okay, I think I get it. It seems the most obvious danger is some kind of DOS attack. One rootless container crashes/disables/breaks the CNI infra. container, which disables all other rootless container's networking. But this scenario is simple, and if known, the exploit is easily covered by testing. |
I 've hit the problem described in #8411 and considered here. I m using Fedora IoT on a raspberry pi 4 (4GB) and tried to spin a container in a network. A repdocible example should be:
|
A friendly reminder that this issue had no activity for 30 days. |
As of today, with the new podman 3.0 release,
the issue mentioned on my previous post
still persists. |
This is currently tracked in #9423 , but it might be good to push arm64 image as a temporary workaround. |
EDIT: this is now tracked in #9423
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind feature
Description
The current dependency on
quay.io/libpod/rootless-cni-infra
has several issues:We can solve all these issues by making
rootless-cni-infra
to be imageless.This can be implemented by executing an equivalent of the following commands in the user namespace:
Also we should consider reimplementing
rootless-cni-infra
shell script in Go withpkg/reexec
.This can be done separately to reduce complexity of PR, but maybe we should do the both at once to reduce extra migration steps.
Challenge
Supporting live upgrade from a previous version might be difficult.
I think we can choose not to support live upgrade.
Related:
The text was updated successfully, but these errors were encountered: