What security concerns should I have with Docker? How should I go about locking it down? #150
-
A common question I get. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 1 reply
-
Security recommendations for Docker on Linux servers, in order of priority.First, research and learn
Then consider each of these a project to implement. Easier ones at top:Note: I've marked each as something you do to the host config or something done in the Dockerfile for the container app itself. This is useful if you're someone who maybe can't control one or the other and only need the below items that are under your purview. (maybe you're a sysadmin and don't control Dockerfiles, or vice-versa).
|
Beta Was this translation helpful? Give feedback.
-
For questions about "is docker secure" (what does that even mean, nothing is perfectly secure unless it's turned off and removed from the internet): Realize that a default Docker install on Linux doesn't open ports to expose Docker remotely. This is a good thing. Even Swarm Mode only opens ports for cluster communications and requires mutual TLS auth in all cases. In version 18.09 we can even remotely control Docker Engine through SSH, preventing 90% of the reasons for exposing TCP ports for remote management in the first place, which is very exciting. The headlines we see about container security concerns largely revolve around two things:
|
Beta Was this translation helpful? Give feedback.
-
Internet news: Graboid: First-Ever Cryptojacking Worm Found in Images on Docker Hub This goes back to the same things I'm saying above:
|
Beta Was this translation helpful? Give feedback.
-
I did a whole YouTube Live Show on this! |
Beta Was this translation helpful? Give feedback.
-
Don't know if this is the place to leave follow-up questions, but I'm wondering about Portainer and the Docker socket. Point 5 says to avoid exposing the Docker socket, but Portainer requires access to the Docker socket. It seems that a code execution vulnerability in Portainer could grant full control of the swarm and root on the host. If that is true, is there a way to mitigate this, or do we just have to trust Portainer? |
Beta Was this translation helpful? Give feedback.
-
On the details of the docker socket:
|
Beta Was this translation helpful? Give feedback.
Security recommendations for Docker on Linux servers, in order of priority.
First, research and learn
Then consider each of these a project to implement. Easier ones at top:
Note: I've marked each as something you do to the host config or something done in the Dockerfile for the container app itself. This is useful i…