fix: confine grok worker state by permissions, not a deny-mount - #11
Merged
Conversation
apresmoi
changed the base branch from
fix/daimon-broker-registration-dir-mode
to
main
September 4, 2026 03:17
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.
Grok has never run in production. Diagnosis, reproduced against the real
grok 1.0.13binary: whenever the sandboxdenylist is non-empty, Grok re-execs inside bubblewrap and tries toopen()a mode-000placeholder it created, to prove the bind-over is genuine. Inside bwrap the process is capability-stripped, the open returnsEACCES, and Grok concludes it is being spoofed:It exits before writing any
ProfileAppliedevent, so Daimon's attestation never runs. Controls confirmed the deny target is irrelevant — a plain directory, a directory with a child mount, and a vanilla root-owned home denying/secret/creds.txtall fail identically. Six previous fixes tuned this path; each uncovered the next thing wrong with it.This removes the mechanism instead.
GROK_SANDBOX_DENY_PATHS = [], so the rendered profile carriesdeny = []and the worker stays on builtin-strictLandlock, which starts cleanly and emits the required event.statejoinsprivateModeDirectories, reusing the ownership guard's existingsecurePrivateDirectory(chown 0:0, chmod 0700, chown 2000:2000, verify — per-segmentO_NOFOLLOW, fails closed). This runs for every Daimon org, not only Grok ones, and needs noCAP_FOWNER.Root cause of the
0755it replaces:privateDirectoriesonly chowned ancestors and never chmoded, so Docker's root-owned 0755 mountpoint survived.Nothing is lost. Landlock
strictalready restricts reads to CWD plus system paths, sostatewas reachable by a worker only with Landlock off — and the real alternative was not stronger confinement but no worker at all, since Grok refuses to start with a non-empty deny.Review
An independent security review verified that no worker-uid reader touches
state(the only child,state/wake-acceptance, is already0700 2000:2000, so every working reader is uid 2000 or a rootdocker execholdingCAP_DAC_READ_SEARCH), and confirmed the broker's ancestor-traverse loop never walks throughstate— it visits only workspace ancestors, andstateis a sibling.The render test was tautological — it asserted against a locally built string. It now extracts and executes the
deniedPathsandprofileForlines from the rendered program and asserts the resulting bytes; repopulating the deny list turns it red.Requires the companion daimon change (
fix/grok-attestation-empty-deny), which accepts an empty deny list against the pinned profile hash.