Repository navigation
Conversation
services.agent-box.secrets.enable and the native `secrets.enable` now
default to true; `secrets: {enable: false}` still turns it off.
- Move the two secret-custody tmpfiles rules into the module's named
tmpfilesRules inventory (gated on secretsEnabled) so the golden
snapshot and one-spec-both-backends see them; with the default off
they were invisible to both.
- backend-parity: drop the stale AGENT_BOX_SECRET_SOCKET exception and
declare AGENT_BOX_SECRET_BROKER_ALLOW_DEV_LAUNCHER (a dev gate the
broker only reads, never supplied by any unit) as by-design.
- Regenerate modules/agent-box.nix, tests/golden and tests/native.
tests/secrets.nix (the VM test for the root/uid boundary) still does
not exist; this change does not add it.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
tests/secrets.nix boots one node with two Linux users and checks what the unit tests (DirectLauncher, one uid) cannot: socket/dir modes, a root-only key, SO_PEERCRED refusing root and a second user, the systemd-run User= uid drop, scoped injection and redaction, control-group reaping on cancel and timeout, store persistence across a broker restart, a corrupt record, and env-exec stripping (tombstones included). Registered in vmTestsFor and the `host` CI lane. Found while running it under TCG on aarch64: - A web-less box got no /var/lib/agent-box-secrets, so the broker failed 226/NAMESPACE in a restart loop. The tmpfiles rules now live in secretsTmpfilesRules, applied by the broker block itself and added to internal.tmpfilesRules for the golden inventory only. (The previous commit on this branch had moved them into the web-gated list, which caused exactly this.) - SystemdLauncher ran `python3 <worker>` with a bare python3 that a NixOS service PATH does not have; it now execs the worker by its absolute path (the generated script has a store-path shebang). Not yet run to completion: the x86_64 test needs KVM, and under TCG the guest boots too slowly to finish inside the driver's 3600s limit. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
|
CI note on b0012f6 (triage session, nothing pushed):
So in the test VM the broker is still off, even though the PR turns it on by default. Likely the test machine config (or a module gate) does not take the new default. The other VM lanes' |
|
CI run 43768360724 (VM host,
Cause (test bug, not the default flip): I did not push to your branch. Native checks passed; only VM (host) and the CI gate are red. |



Part of #922. Draft until the new
secretsVM check is green in CI.What
secrets.enablenow defaults to true on both backends (NixOS option and nativeSpec).secrets: {enable: false}turns it off.tests/secrets.nix(registered invmTestsForand thehostlane): one node, two users (agent,robot). It checks socket/dir modes, root-only key, SO_PEERCRED refusing a second user and root, thesystemd-run User=uid drop, scoped injection and redaction, control-group reaping on cancel and timeout, persistence across a broker restart, a corrupt record, and env-exec stripping (tombstones included).web.enableoff,/var/lib/agent-box-secretswas never created, so the broker failed226/NAMESPACEin a restart loop (seen in a TCG boot). The tmpfiles rules are nowsecretsTmpfilesRules, applied by the broker block and added tointernal.tmpfilesRulesfor the golden inventory.SystemdLauncherranpython3 <worker>with a barepython3that a NixOS service PATH lacks; it now execs the worker by absolute path.modules/agent-box.nix,tests/golden,tests/native; backend-parity allowlist updated (AGENT_BOX_SECRET_SOCKETstale entry removed,AGENT_BOX_SECRET_BROKER_ALLOW_DEV_LAUNCHERdeclared by design).Security effect
Every box gets a root-owned broker per configured user by default. The root/uid boundary has never run end to end; this PR's VM test is the first attempt, so please do not merge before it is green.
Checks run (aarch64)
module-generated-up-to-date, golden-snapshot, backend-parity, one-spec-both-backends, secret-custody, assemble-module-escaping, module-single-file;
python3 -m unittest tests.test_agentbox(189 pass);ruff --select Fandtyon the extracted test script;nix eval .#checks.x86_64-linux.secrets.drvPath.Not verified
The
secretsVM test has not run to completion: it needs x86_64 KVM, and a TCG run on aarch64 does not boot in time. TheSystemdLauncherchange is untested until CI runs it. Comments saying the VM test is missing are left as they are until it passes.🤖 Generated with Claude Code