Reputation: 13
Here I've written a Dockerfile for testing user access. The other file (run.sh) is on this link
Up to here, I've done this:
Operations with docker:
Up to running a bash with devops user there is no problem due to the restrictions given to /app directory but when I run bash with root user I can do whatever I want and the devops user is useless. How can I correct this security hole?
Upvotes: 1
Views: 2488
Reputation: 1325976
As mentioned in issue 8664:
If someone has access to Docker, they have access to your entire system, can join namepsaces, etc.
Disablingdocker exec
would not enhance security at all.
If you can run docker exec
, you can run it as root in any running container. That is not a bug or a security risk. That is a feature.
From issue 8798:
I think
exec
is mostly useful for debugging a container and therefore it is necessary to be able to exec asroot
.
The OP Agustín Alba Chicar confirms (in the comments) with issue 18640
(Brian Goff -- cpuguy83
's answer)
No.
By convention, any user with access to docker has full root access to the host, which makes root access to the container moot.Docker now has an authorization framework in master, which can be used to limit this sort of access. It will be available in Docker 1.10.
Upvotes: 2