selinux-dockersock icon indicating copy to clipboard operation
selinux-dockersock copied to clipboard

This should be stated that this is very dangerous.

Open rhatdan opened this issue 2 years ago • 3 comments

If a container process gains access to this socket or the podman socket then it has full control on the system. IE Full root. Basically the container process does a

docker run --ti --privileged fedora sh and it has a full root running process on the system, and only needs to escape mount namespace.

rhatdan avatar Sep 27 '21 18:09 rhatdan

This opens this access to all containers. If access to the docker.socket is needed within a container on an SELinux system, SELinux separation should get disabled.

docker run --security-opt label=disabled podman run --security-opt label=disabled

Then only the container running with the docker.sock or Podman.sock gains the dangerous access.

rhatdan avatar Sep 27 '21 18:09 rhatdan

I avoid using Docker as much as possible, unfortunately there are few exceptions where I have to run it and what @rhatdan is stating is absolutely crucial to understand and this policy should not be used in prod or on any public instance. Also, switching to podman solves a lot of issues.

apinter avatar Jan 10 '22 05:01 apinter

This opens this access to all containers. If access to the docker.socket is needed within a container on an SELinux system, SELinux separation should get disabled.

docker run --security-opt label=disabled podman run --security-opt label=disabled

Then only the container running with the docker.sock or Podman.sock gains the dangerous access.

Thank you this flag is what I was looking for so I didn't need to install this entire plugin

djtango avatar Dec 14 '22 14:12 djtango