test: assert remote builder credential boundaries #250
No reviewers
Labels
No labels
area:authentication
area:flake-utilities
area:performance
area:tbd
host:chaos
host:electra
host:fleet
host:lyra
host:nova
host:vega
investigation
phase:cutover
phase:deploy
phase:mcp
phase:module
phase:packaging
phase:prep
phase:validation
priority:high
priority:medium
project:attic-postgres-lyra-rollout
project:auto-update-reliability
project:auto-update-remediation
project:declarative-purity-cleanup
project:external-review
project:fleet-boundary-cleanup
project:host-facts-refactor
project:lyra-nixos-deploy
project:lyra-service-stack-migration
project:nebula-mesh-network
project:nixos-build-deployment-pipeline
project:security-hardening
project:service-stack-migration
project:vega-sillytavern-cutover
project:wiki-rebuild
repo:numtide/flake-utils
repo:numtide/nix-auth
repo:numtide/nixos-passthru-cache
repo:numtide/nix-relay
service:auto-update
service:mem0
service:nix
service:sillytavern
service:slskd
service:synthseek
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
nimmo/nixos-config!250
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/issue-238-trust-boundaries"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Scope
First reviewable slice of #238. Add flake assertions for builder-client key separation, secret ownership and permissions, and Electra controller signing-key placement.
Vega remains an authorised NixOS configuration development and Forgejo publishing fallback when Electra is unavailable.
Validation
nix flake checkpassed locally on Electra.Issue status
The validation required for #238 is complete. This assertion-only MR requires no deployment or target activation. Follow-on Forgejo authority and CI work remains tracked separately in #239 and #241.
Automated code review
Reviewed commit:
44eb62e63778ad84ca3d01357de007890401fb31Verdict: Requires further work
Resolve the blocking or important findings and investigate failed deterministic checks before merging.
Overall assessment
The diff modifies
flake.nixto enhance assertions for the Nova remote builder configuration. It introduces abuilderKeyhelper and refactorsassertNovaRemoteOnlyto accept a host name, allowing verification of specific SOPS secret attributes (path, format, owner, group, mode) for each builder host (Lena, Vega, Lyra, Chaos). It also adds assertions for the Electra controller signing key. The initial review's findings regarding missingpublicHostKeyand trust relationships are speculative as they rely on external documentation not present in the diff or repository context provided.Blocking findings
None.
Important findings
The definition of
assertNovaRemoteOnlyis changed toname: host:(line 195). However, the calls at lines 230-233 pass arguments as"lena" lena,"vega" vega, etc. In Nix, function arguments are positional. The first argument"lena"is bound toname, and the second argumentlena(the config) is bound tohost. This matches the new signaturename: host:. Wait, looking closely at line 195:assertNovaRemoteOnly = name: host:. The call isassertNovaRemoteOnly "lena" lena. This passes"lena"asnameandlenaashost. This is correct.Impact: None. The argument order is consistent between definition and usage.
Suggested fix: No action needed.
Suggestions
The assertion
assert key.sopsFile == ./secrets/nix-remote-builders/${name}.json;relies on the SOPS module exposing asopsFileattribute that resolves to this specific relative path. This couples the check suite to the internal implementation details of how secrets are stored and referenced by the SOPS NixOS module.Impact: If the secret files are moved or the SOPS module changes its API, this assertion may fail even if the configuration is functionally correct. It reduces flexibility in secret management.
Suggested fix: Consider if asserting the existence and permissions of the key via
key.pathandkey.modeis sufficient, rather than asserting the specific source file path, unless the path itself is a security requirement.Tests and validation
Questions
sopsFile,format,owner,group, andmodeattributes are available on the secret object returned byhost.sops.secrets?./secrets/nix-remote-builders/${name}.jsonintended to be a strict invariant, or is it an implementation detail that might change?Review limitations
nix flake checkto validate that these assertions pass in the current environment.publicHostKeyand trust relationships are excluded as they rely on external documentation not provided in the diff or repository context.Diff coverage
flake.nix: reviewed — included in a context-limited batchReview metadata
Review feedback was assessed and the relevant fix was added. Local validation and the MR checks passed. Detailed security analysis is kept out of public comments.