Skip to content

Grant workers confine themselves under the namespace sandbox #22

Closed
1 of 1 issue completed
Closed

Description

@sodre

Parent

#21

What to build

Every grant worker in today's deployments gets the base layers that ADR 0001 defines. The Gateway library gains a worker sandbox module with one operation: confine the calling process as a grant worker. It reports the layers it applied, or fails naming the layer that failed. The grant worker calls it as the first thing it does, before it reads its control socket. Under the namespace sandbox, that happens inside bubblewrap, which is still launched as today.

The base layers, in order:

  1. Non-dumpable.
  2. Landlock: every access right the kernel's ABI knows, with no rules granted. No Landlock is reported as unavailable, not as an error.
  3. no_new_privs and the seccomp allow-list. The allow-list permits only what a confined grant worker needs: receiving descriptors, its streams, threads, memory, randomness, clocks and exit. It checks the architecture and, on x86-64, rejects x32. Signals are allowed only to the grant worker's own process. Anything else kills the process.

The startup probe's worker confines itself and reports its layers over the control socket, and the supervisor logs the sandbox and each layer. A grant worker that dies by SIGSYS is logged as killed by the worker sandbox's filter and fenced through the existing worker-failure path, so its grant needs fresh approval.

ADR 0001 and the first GLOSSARY.md (on branch docs/18-worker-sandbox) land with this ticket. Use their terms: grant worker, worker sandbox, namespace sandbox, filter sandbox.

Acceptance criteria

  • The worker sandbox module is public in the Gateway library, with one confine operation that reports the applied layers (allow-list, Landlock ABI or unavailable, non-dumpable) or names the layer that failed
  • Every grant worker, including the startup probe's worker, confines itself before reading any input
  • Startup logs the worker sandbox and each layer applied, including the Landlock ABI version or "Landlock unavailable"
  • A new Rust integration test confines two concurrent stand-in grant workers through the module, hands each a stream by SCM_RIGHTS, and proves for each: the stream arrives and threads work; opening a file, reading the supervisor's environment, reading the supervisor's memory, reading the other worker's memory, TCP connect, UDP send, running a program and signalling another process are all refused; signalling itself works; a forbidden system call kills it with SIGSYS
  • The allow-list rejects a foreign architecture, and the x32 range on x86-64
  • A grant worker killed by SIGSYS is logged as killed by the filter, and its grant is fenced and needs fresh approval
  • The existing runtime test passes unchanged under the namespace sandbox in CI (sidecar and shared mode, concurrent users, cutoff, revocation)
  • ADR 0001 and GLOSSARY.md are merged with this change
  • CI runs the Gateway crate's tests, the worker sandbox containment test among them, and the runtime test on arm64 Linux
  • A host that refuses Landlock's version query with EPERM, as a container profile older than Landlock does, is reported as Landlock unavailable, and the grant worker is still confined

Decided in: #21 (spec); ADR 0001; the probe and research on prototype/18-isolation-probe
Live step at merge: none

Activity

  1. added theissue type on Nov 20, 2026
  2. self-assigned this
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions