Declare the host user's credential files from the hypervisor identity #75
No reviewers
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/archetypes!75
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/host-user-credentials"
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?
The hypervisor builder now places two files in the human account's home from its identity: the account's own Forge API token at
~/.config/git/forgejo-tokenand the site hosting rclone config at~/.config/rclone/rclone.conf, each an agenix-owned symlink, mode 0600, and each only when the identity names an age file for it. Nothing changes for any machine today: the template identity has neither field, the module reads them withor null, and the template hypervisor still generates zero age secrets against the current secrets pin. A new check builds the template hypervisor both ways and pins the exact secret set (file, path, owner, group, mode, symlink) plus the generated decrypt activation; it was shown to fail on a wrong mode and onsymlink = falseand pass again when reverted. If this is wrong, a deployment that has set the fields sees the difference only after its own secrets change plus a rebuild; reverting means dropping the one import line inmkHypervisor. A deployment that carries its own placement module for these paths deletes it after its pin advance, otherwise agenix declares the same secret twice.Closes allod/archetypes#74. Refs allod/strategy#51, allod/secrets#17.
What changed
modules/host-user-credentials.nix: takesidentityfromspecialArgs, declaresage.secrets.user-forgejo-tokenandage.secrets.site-hosting-rclonefromuserForgejoTokenFileandsiteHostingConfigFile, and refuses a string value with the same path-or-null contractmkDevVmenforces (allod/archetypes#70 may relax both together). The header states the agenix facts read from the pinned revision:installSecretrunsmkdir -pon the custom path's parent as root, installs withln -sfTso a hand-written file is replaced in place, and cleanup removes only the previous generation so a dropped declaration leaves a dangling symlink for the operator.flake.nix:mkHypervisorimports the module besidenetrc.nix; ahost-user-credentialscheck, modelled ondev-forge-opt-out, asserts the null branch (neither secret, no activation text naming either), the fixture branch (literal projection and a grep of the generated agenix install script for both ciphertext basenames, after forcing the toplevel so module assertions run), and the string-form sabotage for each field with a path-form control.checks/fixtures/host-user-credentials/*.age: two placeholder files whose Nix paths the fixture branch uses; the content is a comment, never decrypted.README.md: one sentence under the credentials section.The hypervisor builder composes no
age.identityPaths; the consumer's own module owns that (nexusdocs/integration.md, "Consumer-owned configuration"), so the check supplies one through the existingdefinition.nixosModulesseam for the fixture only.Risk
R1. The module is inert until an identity names a file. On a host whose first activation runs before the account exists, agenix creates
/home/<user>and~/.configroot-owned ahead of theusersstep, and a root-owned~/.configblocks the account from creating anything beneath it until chowned; the dev-machine token module has the same exposure on every fresh dev VM, and a real hypervisor already has the account. The check's fixture branch is the only place a hypervisor with these secrets has been evaluated; no deployment was rebuilt. Not run:fleet-diffagainst a deployment that sets both fields, since none is reachable from this public checkout.Validation
nix build .#checks.x86_64-linux.host-user-credentialspasses on the final commit.0644fails the check withwith-access fixture no longer generates today's two secrets...; settingsymlink = falseon both fails the same way; each reverted and rebuilt green.nix build .#checks.x86_64-linux.dev-forge-opt-outstill passes.nix eval --json .#nixosConfigurations.nexus.config.age.secretsis{}and the template hypervisor'ssystem.build.toplevel.drvPathevaluates against the current secrets pin, which lacks the fields.symlink; the header names which tool reads the user token, scopes the activation-order claim to the activation-script path, names~/.configitself among the root-owned parents on a first activation, and separates the one-removed and both-removed cases. Rejected against source: the fixture's coupling to the template hypervisor (thedev-forge-opt-outprecedent, and whatmkHypervisorneeds for platform and hardware), an explicitsymlink = true(agenix's default, present on every evaluated secret), and the cost of the string-form sabotage fixtures (same shape asdev-forge-opt-out, forcing onlyconfig.age.secrets).Labels are unavailable to this token; none is warranted.