Why this matters
The Docker socket is the daemon’s control plane. Anyone who can write to it can launch any container with any configuration.
The attack, run from inside a socket-mounted sidecar:
docker run --rm --privileged -v /:/host alpine \
chroot /host cat /etc/shadow
One command. No kernel exploit. The Docker API permitted it by design.
Fix
Replace with a socket-proxy:
services:
socket-proxy:
image: tecnativa/docker-socket-proxy
environment:
- CONTAINERS=1
- IMAGES=1
- NETWORKS=0
- VOLUMES=0
- POST=0
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks: [obs]
monitoring:
image: telegraf:1.30
networks: [obs]
depends_on:
- socket-proxy
environment:
- DOCKER_HOST=tcp://socket-proxy:2375
The proxy exposes only GET /containers and GET /images — read
access, no write. The attack above cannot succeed because POST is
disabled.