by fpgaminer · 8y ago · 0 comments
Neat idea. However, to accomplish this you have to mount the docker socket into Traefik's container...
Which means that when a bug shows up in Traefik attackers can pivot out of the container and onto the host; access to the docker socket is equivalent to root on the host.
And of course Traefik is the thing you're exposing directly to the internet.
It's like giving the guards outside manning your castle's gate the skeleton key to the rest of the castle.
Of course, Traefik is quickly becoming popular because of its simplicity. But to achieve this simplicity it carves a giant hole in the security of your application.
mounting the socket readonly doesn't help.
So no, Traefik is not the big security problem you make it out to be.
Sorry to be so harsh, but Traefik is one of the most amazin pieces of software I have come across in the last years that has seriously made my life much easier.
Security today doesn't mean that you are safe if you do everything according to best practices and follow the docs. Modern Security includes making sure that default settings are safe, and that it should be impossible or hard to set up the software in an insecure manner.
If you make it easy to shoot yourself in the foot, that's what people will do.
Yes they will. Just repeating it here because it bears repeating.
Yes, they don't care. And yes, there will be an attacker trying to exploit it.
Sure its not a problem if you use k8s, mesos, consul, or any of the other schedulers, but the security gap is still there.
[1] https://docs.traefik.io/user-guide/swarm-mode/#deploy-trfik
It then iterates over those containers and writes a nginx.conf file to a shared volume, then sends a SIGHUP signal to another container running nginx as a reverse proxy to the containers.
The "polling job" container doesn't expose any ports and is not reachable from the outside world and the only input into this program is reading data from the Docker Socket.
Do you think this is still vulnerable to attacks like Traefik is or does this 2-container routing protect against the attacks you're thinking of?
As others have suggested, Traefik should really be doing something similar (or Docker should add ACLs to its API).