fix(security): replace direct Docker socket mount with restricted proxy - #2489
Closed
failsafesecurity wants to merge 1 commit into
Closed
failsafesecurity wants to merge 1 commit into
failsafesecurity wants to merge 1 commit into
Conversation
Traefik mounted /var/run/docker.sock directly (even :ro), which grants root-level access to the Docker daemon. Any compromise of the Traefik container gives full control over the host's containers, images, volumes, and networks. Replace the direct mount with a tecnativa/docker-socket-proxy that only exposes read-only container/service/task endpoints (POST=0). Traefik points to the proxy via --providers.docker.endpoint. Signed-off-by: Yajat Kapur Failsafe <yajat@getfailsafe.com>
Contributor
|
This was marked as potentially AI generated and will be closed now. If this is an error, please provide additional details, make sure to read the docs about contributing and AI. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Security fix: Traefik mounts Docker socket read-only (still grants root)
Severity: HIGH
CWE: CWE-250 (Execution with Unnecessary Privileges)
File:
compose.ymlWhat this fixes
Traefik mounted
/var/run/docker.sockdirectly with:ro. Read-only on the Docker socket does not prevent write operations through the Docker API — any process with read access to the socket can still callPOST /containers/create,POST /images/load,POST /networks/connect, etc. A compromise of the Traefik container gives full root-level control over the host's Docker daemon (all containers, images, volumes, networks, secrets).The change
Replace the direct Docker socket mount with a
tecnativa/docker-socket-proxysidecar that:/var/run/docker.sock(read-only)CONTAINERS=1,SERVICES=1,TASKS=1POST=0--providers.docker.endpoint=tcp://docker-socket-proxy:2375This is the standard remediation for Docker socket exposure in compose-based deployments. Traefik only needs to list containers and read labels — it never needs to create, start, stop, or remove containers.
Impact if unpatched
If an attacker achieves code execution inside the Traefik container (e.g., via a crafted request, plugin vulnerability, or misconfigured rule), they can:
Prepared by OpenClaw BountyBot. Finding surfaced by Failsafe Nexus (Pandora) and the patch adversarially reviewed by GLM. Please review carefully — automated patches are a starting point, not a guarantee.