Repository navigation
fix(lab): put the lab, SOC and sensor Alloys behind a Docker socket proxy (#836) - #867
Merged
Merged
Conversation
…roxy (#836) alexander, odin and fenrir each mounted /var/run/docker.sock into Alloy. `:ro` does not stop POST /containers/create, so that was root on three VLAN 30 hosts, two of them holding age keys, while docs/security.md named only oracle. - each stack gets the estate's docker-socket-proxy (#193): same digest, same GET-only allowlist; Alloy reads the API through DOCKER_API, which docker.alloy already honours, and the socket mount is gone - check_compose_health.py fails on any docker.sock mount outside the proxy image (four fixtures); CI runs it on every stack - docs/security.md, the stack READMEs, README.md and architecture.md say so oracle's agent is a `docker run` from deploy-agent.sh, outside any compose file, and is still direct; recorded as open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gerrrt
enabled auto-merge (squash)
October 3, 2026 14:23
3 of 5 tasks
…n-out pin (#836) check_image_pins.py refused the self-test's literal tecnativa/docker-socket-proxy:v0.5.0@sha256:... as a pin outside compose.yaml, which it is. The guard matches on the image prefix, so the fixture is built from SOCKET_PROXY_IMAGE instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Retained rootfs mounts allow proxy bypass, and the guard misses /run/docker.sock mounts.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Extends the estate’s Docker socket proxy approach to the lab, SOC, and sensor stacks to limit Alloy’s Docker API access.
Changes:
- Adds pinned GET-only proxies and redirects Alloy clients.
- Adds a Compose socket-mount guard with four fixtures.
- Updates service inventories and security documentation.
| File | Description |
|---|---|
| stacks/soc/README.md | Lists the new proxy. |
| stacks/soc/compose.yaml | Adds proxy and redirects Alloy. |
| stacks/sensor/README.md | Lists the new proxy. |
| stacks/sensor/compose.yaml | Adds proxy and redirects Alloy. |
| stacks/lab/README.md | Updates service inventory and counts. |
| stacks/lab/compose.yaml | Adds proxy and redirects Alloy. |
| scripts/check_compose_health.py | Adds socket-mount guard and fixtures. |
| README.md | Updates lab service count. |
| docs/security.md | Describes proxy coverage and remaining exposure. |
| docs/changelog.md | Records the change and deployment status. |
| docs/architecture.md | Adds alexander’s socket proxy. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
… cannot be bypassed (#836) Review on #867 found two ways around the proxy: - /:/rootfs:ro carries /rootfs/run/docker.sock. A read-only mount does not stop connect() on a socket, and Alloy runs as uid 0, the socket's owner, so every Alloy, the estate's behind #193's proxy included, could reach the full Docker API with no capability at all. /rootfs/run is now an empty tmpfs in all four (observability, lab, soc, sensor), and smaug's node-exporter gets the same at /host/run. Nothing reads /run: the journal is /var/log/journal, and tmpfs is excluded from the filesystem collector and from every host.rules.yaml rule. - the guard matched /var/run/docker.sock only. On Ubuntu /run/docker.sock is the same file. It now refuses both spellings, a mount of /run or /var/run, and the host's / without a tmpfs over <target>/run. Ten fixtures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gerrrt
added a commit
that referenced
this pull request
Oct 3, 2026
…ay a docker run reaches the socket The review finding on #867 applies here: deploy-agent.sh gives Alloy -v /:/rootfs:ro, which carries /rootfs/run/docker.sock past the new proxy, because a read-only mount does not stop connect() and Alloy is the socket's owner. Alloy now gets --tmpfs /rootfs/run. check_image_pins.py's socket rule now matches check_compose_health.py's: the socket under either spelling, a mount of /run or /var/run, or the host's / without --tmpfs over <target>/run. Nine fixtures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/changelog.md
Gerrrt
added a commit
that referenced
this pull request
Oct 3, 2026
…k every docker run for the socket (#868) * fix(agent): put oracle's Alloy behind a Docker socket proxy, and check every docker run for the socket oracle's Alloy is a `docker run` in deploy-agent.sh, not a compose service, so neither #193 nor #836's compose check reached it, and it kept /var/run/docker.sock mounted: root on the host, since `:ro` does not stop POST /containers/create. - deploy-agent.sh's Docker runtime starts alloy-socket-proxy beside Alloy on a private `alloy` network: the estate's image (image-for.sh docker-socket-proxy) and its GET-only allowlist. Alloy reads the API via DOCKER_API, and its socket mount is gone. - check_image_pins.py refuses a socket bind in any `docker run` in the repo except one running an image traced to the proxy service (five fixtures under --self-test). Its first run found exactly this site. - docs/security.md, add-monitored-device.md and the changelog say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(agent): mask /rootfs/run on oracle's Alloy too, and catch every way a docker run reaches the socket The review finding on #867 applies here: deploy-agent.sh gives Alloy -v /:/rootfs:ro, which carries /rootfs/run/docker.sock past the new proxy, because a read-only mount does not stop connect() and Alloy is the socket's owner. Alloy now gets --tmpfs /rootfs/run. check_image_pins.py's socket rule now matches check_compose_health.py's: the socket under either spelling, a mount of /run or /var/run, or the host's / without --tmpfs over <target>/run. Nine fixtures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(ci): exempt a socket mount only when the run's IMAGE is the proxy, not when its variable appears anywhere Review on #868: the exemption accepted a proxy-traced variable anywhere in the arguments, so `docker run -e "$PROXY_IMAGE" -v /var/run/docker.sock:... "$IMAGE"` passed while the collector held the socket. The rule now finds the image operand (the first positional, past flags and their values) and exempts only when that is the proxy. Unknown boolean flags misparse toward refusing, never toward allowing. Four new fixtures: three decoys, and the real proxy run from deploy-agent.sh flag for flag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/changelog.md # docs/security.md
# Conflicts: # docs/changelog.md
# Conflicts: # docs/architecture.md # docs/changelog.md # stacks/lab/README.md # stacks/sensor/compose.yaml
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.

What changed
stacks/lab,stacks/socandstacks/sensoreach get adocker-socket-proxy, the estate's from Put the Docker socket behind an allowlisting proxy — Alloy can still POST to it #193: the same pinned digest and the same GET-only allowlist (CONTAINERS,IMAGES,INFO,VERSION,EVENTS,NETWORKS;POST: 0).DOCKER_API: tcp://docker-socket-proxy:2375, whichdocker.alloy's three components already read, and its socket mount is removed.scripts/check_compose_health.pyfails on anydocker.sockmount in a compose file outside the proxy image, matched by image, not service name, in the short and long volume forms.--self-test.ci.yml, Verify health dependencies…).docs/security.mdnamed onlyoracleas still exposed and now names all four. The three stack READMEs,README.mdanddocs/architecture.mdlist the new service.Why
Refs #836.
:roon the socket applies to the file, not the API behind it:POST /containers/createwith/bound read-write still works, so each bare mount was root on its host. All three hosts sit on VLAN 30, the segment built to hold attackers. alexander holds the lab's only age key (#671), and odin holds the SOC's key and Velociraptor's CA.Blast radius
alexander, odin and fenrir, each at its next
make up. None of them converges, so merging changes nothing that is running.The failure to watch for is the one #193 measured: a too-narrow allowlist does not error, it just collects less. The allowlist is the estate's verbatim, including
NETWORKS, without whichdiscovery.dockerfails and container logs stop while the agent stays healthy. After deploying, check thatloki_source_docker_target_entries_totalis climbing on each guest.Expect a merge conflict with #865. It also edits these three compose files and the lab README's service count, in different services. Whichever merges second needs the count set to six (caddy and the proxy both).
expose:only.secrets/*.sops.yamlVerification
check_compose_health.py --self-test: the four new fixtures pass.Before the fix, the check flagged exactly the three Alloys and passed
stacks/observability. After it, all eight stacks pass.check_docs.py, yamllint and markdownlint pass on every changed file.Not run locally, because this machine has no Docker:
docker compose configand the image probe. CI runs both.make validatepasses (CI)Deployed: on each guest,
docker logs <stack>-docker-socket-proxyshows no 403s, and container logs still reach the lab's LokiDocs updated
Not covered
oracle's agent still mounts the socket. It is a singledocker runindeploy-agent.sh, not a compose service, so the new check cannot see it. It is recorded indocs/security.mdand the changelog.🤖 Generated with Claude Code