-
Notifications
You must be signed in to change notification settings - Fork 114
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
Mounting host's root file system inside container security issue #439
Comments
Hi @huornlmj thanks for the update be aware that we mount this as we need the all file system in the right order so we can run chroot from inside the container |
Can you explain what is being chrooted? Is it the entire host fs? |
yes so we can run systemd and other host configuration take a look on in the code for chroot function and see what we do after that command I think it will be the best to understand if we can do that in a different way :) |
Why chroot inside a container though and not just mount what is needed? I would ask the question as to why the host's docker socket is mounted inside the container? As well as the hosts' /etc/shadow file, the host's setuid executable binaries (unmount, mount etc.) a full bash shell environment, the hosts' /tmp/ world-writable directory etc.. I'm naming just a small few items that are used by attackers to escape from a container and compromise the host. The principle of granting nothing and only adding what is needed is not being followed here. |
Hello, A design flaw refers to architectural decisions that might come with To the Intel team and other community members, we warmly welcome your expertise BR, |
sriov-network-operator/bindata/manifests/daemon/daemonset.yaml
Line 99 in bc2291e
This YAML is configuring an SRIOV container to mount the hosts's entire root file system inside the container. This is against basic containerisation best practices and can lead to escape and privilege escalation. Such misconfigurations have been exploited in a number of well known security incidents (Doki, Hildegard, Peirates, Siloscape and TeamTNT).
The solution would be to not mount the entire host root file system in the container and only mount the sub directories specifically required, basically the principle of least privilege.
Consider using the
strace
Linux utility to help identify the specific files and directories are are needed by your processes, and then mount only the most granular required. Also, avoid shifting the mount point down one level to one of the root's directories. I.e., do not blanket mount /dev, /proc, run, etc. or any 1st level directory.I would consider a CVE for this.
The text was updated successfully, but these errors were encountered: