Secure Docker socket proxy with per-client profiles and fine-grained container access control.
1.2K
A minimal, security-focused HTTP proxy in front of the Docker socket.
Instead of mounting /var/run/docker.sock directly into an application, assign each client container a profile with the Docker API permissions it actually needs. Access is denied by default.
socketproxy.role labelall, allowlist, or blacklistdeny or readonlydocker pull cerede2000/docker-socket-proxy:latest
services:
docker-socket-proxy:
image: cerede2000/docker-socket-proxy:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./profiles.yml:/config/profiles.yml:ro
networks:
- socketproxy
networks:
socketproxy:
internal: true
Associate a client with a profile using socketproxy.role (or the socketproxy.service alias):
labels:
socketproxy.role: traefik-manager
Traefik gets only the read access required by its Docker provider. Traefik Manager can inspect and restart only the traefik container.
services:
docker-socket-proxy:
image: cerede2000/docker-socket-proxy:latest
container_name: docker-socket-proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./profiles.yml:/config/profiles.yml:ro
networks: [socketproxy]
restart: unless-stopped
traefik:
image: traefik:v3
container_name: traefik
command:
- --providers.docker=true
- --providers.docker.endpoint=tcp://docker-socket-proxy:2375
- --providers.docker.exposedbydefault=false
labels:
socketproxy.role: traefik
networks: [socketproxy, frontend]
restart: unless-stopped
traefik-manager:
image: ghcr.io/chr0nzz/traefik-manager:latest
container_name: traefik-manager
environment:
DOCKER_HOST: tcp://docker-socket-proxy:2375
RESTART_METHOD: proxy
TRAEFIK_CONTAINER: traefik
labels:
socketproxy.role: traefik-manager
networks: [socketproxy, frontend]
restart: unless-stopped
networks:
socketproxy:
internal: true
frontend:
external: true
traefik:
ping: true
version: true
containers: true
networks: true
events: true
session: true
traefik-manager:
ping: true
version: true
containers: true
post: true
allow_restart: true
container_scope: allowlist
allowed_containers:
- traefik
Dockhand can manage most containers, but never sees the socket proxy. It can inspect Dockman, read its logs and stats, but cannot restart it or open an exec session.
dockhand:
ping: true
version: true
info: true
events: true
containers: true
images: true
networks: true
volumes: true
exec: true
system: true
post: true
allow_start: true
allow_stop: true
allow_restart: true
container_scope: blacklist
blocked_containers:
- docker-socket-proxy
container_rules:
- name: dockman
access: readonly
portainer:
containers: true
images: true
networks: true
post: true
allow_start: true
allow_stop: true
allow_restart: true
container_scope: all
container_rules:
- name: docker-socket-proxy
access: deny
Full documentation, configuration reference, and additional examples: github.com/cerede2000/docker-socket-proxy.
Content type
Image
Digest
sha256:4a5fb112b…
Size
4 MB
Last updated
about 1 month ago
docker pull cerede2000/docker-socket-proxy