News for hackers. Stuff that matters.
Re:Some questions about Docker and rkt by shriphani on Friday September 16, 2016 @05:09AM (#12512759)
While this thread has visibility, I am curious about your typical security model with docker.

From my experience, whoever is running docker seems to be able to run root commands on the host [1].

So any best practices for running docker ?

[1] http://reventlov.com/advisories/using-the-docker-command-to-...

Re:Some questions about Docker and rkt by justincormack on Friday September 16, 2016 @06:37AM (#12513032)
You can use authorization plugins to control what commands are allowed.

However generally you don't give people access to run any docker command in production, you have some system that lets them deploy containers with predetermined settings, which don't include being able to set --privileged or add capabilities or change security policies.

Re:Some questions about Docker and rkt by shriphani on Friday September 16, 2016 @04:47PM (#12517214)
I am currently running docker with a systemd script (it seemed like a reasonable idea at the time).

But docker = sudo without password essentially.

So I am curious if there is a recommended way to run a service with a docker run.

Re:Some questions about Docker and rkt by majewsky on Friday September 16, 2016 @05:36AM (#12512828)
In production, you usually don't want to have users running around and spawning containers anyway. You will likely have an orchestrator like Kubernetes or Mesos or Swarm, who will be running as root and spawning containers for you.

Of course, that just replaces the question of "how is access to the docker daemon secured?" with "how is access to the orchestrator API secured?".

Re:Some questions about Docker and rkt by shriphani on Friday September 16, 2016 @07:44AM (#12513325)
How about something that isn't spawned by an orchestrator - for instance the marathon load-balancer - they provide only a docker image which clearly is meant to be run using `docker run`
Re:Some questions about Docker and rkt by majewsky on Friday September 16, 2016 @08:22AM (#12513494)
I would still run it using an orchestrator, if only to have it restart the container automatically on failure or after your node reboots.
Re:Some questions about Docker and rkt by shriphani on Friday September 16, 2016 @05:20PM (#12517447)
I mentioned this in a sibling comment - I'm currently running the container using systemd which gives me restart ability and all that.

Do you think this is insufficient?

Re:Some questions about Docker and rkt by wlamartin on Friday September 16, 2016 @11:48AM (#12514810)
You are right that docker currently runs as root. There is some phenomenal work that Aleksa Sarai is doing on getting runc to work as an unprivileged user [1] that Docker should be able to take advantage of at some point. There are still a lot of places which need love without root in the Docker world, but it's a huge step forward.

[1] https://github.com/cyphar/runc/tree/rootless-containers

Re:Some questions about Docker and rkt by _joel on Friday September 16, 2016 @11:21AM (#12514601)
Take a look at this pdf - https://www.nccgroup.trust/globalassets/our-research/us/whit...

There is also a docker-bench-security tool set worth checking out.

Re:Some questions about Docker and rkt by r4um on Friday September 16, 2016 @06:12AM (#12512943)
Other security controls aside, for the user thing we make it mandatory to have USER directive in the Dockerfile, else the docker builds fail.
Re:Some questions about Docker and rkt by hackits on Friday September 16, 2016 @10:19AM (#12514152)
I would of though that if you want to restrict developer from doing that you would add commands to the sudoes file? isn't that the whole point of sudo?

Correct me if I'm wrong, I'm interested to know? I'm currently looking into docker and the advantages it brings to deployment instead of using a VM.

Re:Some questions about Docker and rkt by lima on Friday September 16, 2016 @07:39AM (#12513302)
Best practice? Docker daemon access to equivalent to root access, so only allow it for root.