Fail at build time when a machine cannot decrypt a secret it is given #20
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/archetypes#20
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Make a machine refuse to build when it would be handed a secret it cannot decrypt. This is the check issue #17 asked for and did not get: the assertion added for it compared which credentials were present, never whether the machine could actually open them, so the failure #17 describes still lands at first boot rather than at build time.
The rule that works: for every encrypted secret a machine generates, that machine's own host public key must be among the ciphertext's recipients. It fires exactly when activation would fail to decrypt, it generalises to every secret a fork adds rather than naming two by hand, and it never blocks a legitimate credential split — unlike the pairing assert removed in allod/archetypes#19, which refused a machine that may rebuild itself but may not open pull requests.
What it needs
The data is nearly in place.
allod/secretsalready derives every recipient list frommachineHostKeysviavmKeysinsecrets.nix, and already binds that file assecretsNixin its ownflake.nix, where its own checks consume it. It is never exported, soarchetypescannot see recipients.allod/secrets: export it,lib.secretRecipients = secretsNix;. One line.allod/archetypes: for each machine, compare the recipients of everyage.secretsentry's file against that machine's registered host public key, and fail evaluation naming the machine and the secret when the key is absent.Land the export first; the check cannot be written before it exists.
Scope
In scope: the export, the check, and paired fixtures — a machine holding a secret it is not a recipient of must fail, and today's machines must pass.
Out of scope: changing any recipient set, and the
forgejo-token-groups.jsondrift tracked separately.Why it matters beyond this bug
An undecryptable secret currently surfaces during provisioning, which for a new machine is the worst moment: the operator is mid-install and the diagnostic is an
age --decryptfailure that names a file, not the mistake. This turns it into a build-time error that names the machine and the secret.