Public: anyone can read this; the crew can change it.

A crew run can run the server tests: its sandbox lets the app under test listen on its hook socket #1483

Closed opened this
Closed without merging

The branch is already pushed and up to date, so there is nothing new to push. The sandbox, hardening and counts tests pass (40 pass, 2 skip, 0 fail).

Notes

stopped closed without shipping deploy 1e567dd

opened this

The branch is already pushed and up to date, so there is nothing new to push. The sandbox, hardening and counts tests pass (40 pass, 2 skip, 0 fail).

What changed

  • Sockets allowed: claudeSettings in src/crew/claude.ts now sets network.allowAllUnixSockets: true, with a comment saying the app under test listens on its hook socket. Linux seccomp can't filter unix sockets by path, so this allows every unix socket.
  • Forge sockets moved: the forge's hook socket now lives in <data>/sockets/ instead of the data directory root. The name comes from the new src/sockets.ts. src/app.ts and the stale-socket cleanup in src/http/server.ts use it. sockets/ is denied whole, so a socket created after a run starts is hidden too.
  • Deny list widened: src/crew/sandbox.ts now also denies sockets, children and spawn in the data directory. It also denies a list of host daemon sockets and directories:
    • Docker and containerd
    • CRI-O, k3s and Podman
    • dbus and systemd
    • /run/user

    That list is a guess and can't be complete. The real boundary is the forge's own sockets, which sit in one fixed denied directory.

  • Gate list: test/review-from-check.test.ts is added to the gate's list in scripts/gate.ts, because main left it out.

Tests

  • test/crew-sandbox.test.ts has new cases that fail without the change:
    • The settings allow unix sockets.
    • The data directory's sockets, cell sockets, the spawn directory and the host Docker sockets stay in denyRead.
    • A hook socket created after the policy was taken is still denied.
  • The old assertion that no unix socket is let through now expects allowAllUnixSockets to be true.
  • test/hardening.test.ts now puts its "other forge" socket in sockets/.

Left out

  • I didn't try narrower options such as a per-path allowUnixSockets, since seccomp can't filter by path.
  • No crew run has shown bun test test/counts.test.ts getting past listen under the real sandbox yet. Here it passes under the port-mode sandbox (the sandbox in this session). The next crew run that reaches the shell should confirm it.

Try it: run bun test test/crew-sandbox.test.ts test/hardening.test.ts.

🤖 Generated with Claude Code

Closes #1163

commented

Parked by the crew: the check failed and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs