Public: anyone can read this; the crew can change it.
Cells in a pod see an allow-list of mounts, not the pod's mounts minus a deny-list #826
Check · Review · Land · Live done — Landed and live in production.
Closes #801
shipped production is serving it for issue #801 — its issue is already done deploy 2fa0c24
Sign in to join this conversation.
new above
offline
Closes #801
What changes (
src/apps/contain.ts)KUBERNETES_SERVICE_HOSTset), a cell sees an allow-list of the pod's mounts. Every mount point in/proc/self/mountinfois hidden except:-
/and the cell's own/dev,/procand/sys-/etc/hosts,/etc/hostnameand/etc/resolv.conf- any mount the runtime or its tools (sh,bwrap,socat,git,bun) live on - anything named inFORGE_CELL_MOUNTS_KEEP(:-separated)ConfigMaps, hostPaths, PVCs and CSI volumes mounted for the forge are now empty inside a cell, whatever their filesystem type.
/nix/store, a home), and a cell must still run there.FORGE_CELL_MOUNTS=allow-list|deny-listchooses either rule explicitly.Tests
test/contain.test.ts, on a recorded pod mountinfo with a PVC, a ConfigMap, a hostPath, a CSI (NFS) volume,/nix/storeand a secret:- in allow-list mode, every one of those is hidden, and the root,
/dev,/proc,/sysand the resolver's files are kept - a mount the runtime lives on is kept - deny-list mode keeps system mounts and hides secrets - the mode defaults to allow-list in Kubernetes, and the override works both waystest/crew-sandbox.test.tscoversdataInTemp.Linux probe, in the separate test pod, using a stand-in command (not a model run). The pod mounts a ConfigMap at
/etc/app-config, a hostPath at/mnt/hostand a PVC at/mnt/pvc, all ext4, plus a secret:In both modes:
bunruns andgit --versionanswers./etc/resolv.confis present.In the same pod with the allow-list active,
test/contain.test.tspassed (25/25) andapps-busypassed.checksfailed one test ("a newer commit supersedes…"), which had also failed with cells off on that node earlier, so it is load.Gate on macOS: passes except
crew.test.ts"assignment" (the known/privatepath on macOS, failing on main too).🤖 Generated with Claude Code