Sushi Kitchen
Gunkanmaki
Gunkanmaki

Docker Socket Proxy

gunkanmaki.dockerproxy

A Docker Compose file for Docker Socket Proxy alone, generated from the catalog and checked by the safety inspector. No account needed.

HAProxy-based filter placed in front of the Docker daemon socket that permits only whitelisted API endpoints, so a container can read runtime metadata without gaining control of the host.

Mounting the Docker socket into a container grants that container effective root on the host, because the Docker API can create privileged containers and bind-mount any path. This proxy takes the socket and re-exposes the API over TCP with each endpoint group — containers, images, networks, exec, POST operations — individually permitted or refused by environment variable, all denied by default. Tools that only need to list containers, such as monitoring agents and reverse proxies performing service discovery, can then be given read access rather than the whole daemon. A first deployment enables only the groups the dependent service needs and confirms the rest are refused.

You know it worked when

  • The proxy starts and the Docker daemon is reachable through it.
  • A permitted endpoint such as the container list returns data.
  • A denied endpoint returns a forbidden response rather than a result.
  • The dependent service operates normally with only its required groups enabled.

Known sharp edges

  • Everything is denied by default, so a dependent service that appears broken is usually missing an endpoint group rather than misconfigured.
  • Enabling the POST group restores write access to the daemon and undoes most of the reason for running the proxy at all.
  • The proxy exposes the Docker API over TCP without authentication, so it must never be published beyond the internal network.
  • Read access to the container endpoint still reveals other containers' environment variables, which routinely contain secrets.
securitydockerproxy