Skip to content

Three Alloy agents still mount docker.sock directly (lab, soc, sensor), and docs/security.md says only oracle does #836

Closed

Description

@Gerrrt

What is true

#193 put the observability stack's Alloy behind tecnativa/docker-socket-proxy with a GET-only allowlist (stacks/observability/compose.yaml:864-908, DOCKER_API: tcp://docker-socket-proxy:2375 at :1057). Three other stacks still hand Alloy the socket itself:

Stack Host Line
stacks/lab alexander compose.yaml:315
stacks/soc odin compose.yaml:451
stacks/sensor fenrir compose.yaml:152

All three use /var/run/docker.sock:/var/run/docker.sock:ro.

docs/security.md:891-893 already makes the argument: :ro on a socket "was worth less than it looked", because the mode applies to the inode, not to the API, so POST /containers/create with a host bind still works. The same document at :906 then names only oracle as still exposed, so the doc is stale as well.

Why it matters

A compromised Alloy, or one with a bad config, has root on these hosts. All of them sit on VLAN 30, the segment built to hold attackers, and two of them hold keys:

What closes it

  • Add the same docker-socket-proxy service to all three stacks, with the same digest and the same allowlist (CONTAINERS=1, INFO=1, everything else 0, POST=0). Point DOCKER_API at it. docker.alloy already reads DOCKER_API, so the shared config needs no change.
  • Correct docs/security.md:906.
  • A guard: have scripts/check_compose_health.py (or check_mounted_config.py) fail on any docker.sock mount in a service that is not a docker-socket-proxy, unless a reviewed allowlist names it. That would have caught all three.

Done when

  • grep -n docker.sock stacks/*/compose.yaml lists only proxy services.
  • The guard fails once, on purpose, against a fixture.
  • Container logs still arrive from all three hosts.

Refs #193. Found in the 2026-10-03 repository review.

Activity

  1. added
    bugSomething isn't working
    securityA credential, an exposure, or a control that is weaker than recorded
    labstacks/lab on alexander (VLAN 30)
    socstacks/soc on odin (VLAN 30)
    on Oct 3, 2026
  2. Gerrrt commented on Oct 4, 2026

    @Gerrrt
    OwnerAuthor

    Done in #867 (c910e50), deployed on 2026-10-04. Checked against Done when:

    • grep -n docker.sock stacks/*/compose.yaml lists only proxy services. On main, every remaining /var/run/docker.sock mount sits inside a docker-socket-proxy service, in each of lab, observability, sensor and soc. Each stack's Alloy reads Docker as DOCKER_API: tcp://docker-socket-proxy:2375, GET-only, on the estate's allowlist.
    • The guard fails once, on purpose, against a fixture. check_compose_health.py refuses any docker.sock mount outside the proxy image. That includes the /run/docker.sock spelling, a mount of /run itself, and an unmasked /. Its --self-test fixtures cover each refusal and pass on main.
    • Container logs still arrive from all three hosts. With the proxies live, sum by (host) (count_over_time({log_type="docker", host=~"alexander|odin|fenrir"}[30m])) on alexander returned alexander 2,776, odin 2,514 and fenrir 1,137.

    Also fixed by the same change: each Alloy's /:/rootfs:ro mount had carried /rootfs/run/docker.sock past the proxy, because :ro doesn't stop connect(). /rootfs/run is now masked in all four stacks, and smaug's /host/run too. docs/security.md now lists every host.

    🤖 Posted by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglabstacks/lab on alexander (VLAN 30)securityA credential, an exposure, or a control that is weaker than recordedsocstacks/soc on odin (VLAN 30)

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions