Skip to content
goTool Español

Solutions · Containers

mi-app: has the engine socket inside

With example names (mi-app, /ruta/al/proyecto). In GoTool, in 🛡 Security, this page shows your project's: your container, your compose file, your WordPress folder.

What's happening

Container mi-app has /var/run/docker.sock mounted (at /var/run/docker.sock): it can ask the engine for anything.

Why it matters

Whoever controls this container can create another one with the machine's disk mounted: that's root on the machine.

What to do

  1. If it doesn't need it: In the compose file (/ruta/al/proyecto/compose.yaml), in service app, remove that volume.
    - /var/run/docker.sock:/var/run/docker.sock
  2. If it only needs to see the containers (a dashboard, Traefik, metrics), put a read-only proxy in front and point it there (DOCKER_HOST=tcp://socket-proxy:2375):
    socket-proxy:
      image: tecnativa/docker-socket-proxy   # con su versión fija
      environment:
        CONTAINERS: 1
        POST: 0
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock:ro
  3. Recreate it with the change (whatever isn't in a volume is lost: that's the point):
    docker compose -f /ruta/al/proyecto/compose.yaml up -d --force-recreate app

How to know it's fixed

  • No .sock must show up:
    docker inspect -f '{{range .Mounts}}{{.Source}} {{end}}' mi-app
  • gotool checks your Docker again on its next pass: once it's gone, it stops showing up.

If you can't do it that way

  • If it really has to drive the engine (a CI that starts containers), do it on a separate machine with nothing else on it, or with Docker in rootless mode.

More

CWE-250 · MITRE ATT&CK T1611

In GoTool, the file with the issue (the Dockerfile, the compose file) is also shown with the solution next to it, and the question for Claude comes ready, with your project's details and without your keys, to paste into your claude.ai.

Ask us for a demo