private path: clean machines fail enroll — the app never bootstraps the sops age key the secret kanidm ca var needs #313

Closed
opened 2026-08-06 18:50:41 +00:00 by ben · 2 comments
Owner

The clean-install drive found it (2026-08-06)

Ben's true-clean drive (no state dir, no Nix, no ~/.config/sops) failed the private path's enroll leg at disk layout with, at the bottom of the honest error:

No SOPS key found. Please generate one with `clan secrets key generate`.

Why every clean machine will hit this

The fleet-seeding arc deliberately made kanidm's TLS ca var SECRET (ADR 0105; STATUS names it as the fourth spike delta — a public var's .path needs the file on disk at eval time, which the install stage's generate step hasn't run yet). Secret clan vars are sops-encrypted, which requires:

  1. an operator age key at ~/.config/sops/age/keys.txt (clan secrets key generate), and
  2. that key registered as a sops admin user in the config repo (clan secrets users add operator --age-key <pub> — writes sops/users/operator).

Nothing in the app performs either step. Every drive before this arc passed because the repo's vars were public-only (state-version); every truly clean machine now fails at enroll, with the sops line buried under clan: disk on gateway: the disk could not be laid out.

The live drive was unblocked manually with exactly those two commands (pinned clan CLI from the store); the key + sops/users/operator now exist on benz-HP.

What the fix owns

The private path is app-managed clan end-to-end (ADR 0125) — the app must own this bootstrap too. Likely shape: the seed leg (or the enrollment install stage's opening, next to vars generate) ensures the key exists and the operator user is registered, through the pinned CLI, fail-loud on either step (ADR 0100). Idempotent: both steps are no-ops when already present.

The custody ruling this needs (why ready-for-human)

The age private key is crown-jewel-adjacent — whoever holds it can decrypt every secret var in the config repo:

  • Does the S12 scrub remove it (like the community-CA home) or is it designed residue (like the guest-trust key)? It lives OUTSIDE the app's state dir, in the operator's own ~/.config/sops — scrubbing a shared-tool location the operator may also use for other clans needs care.
  • Does the recovery kit carry it? Losing it after hand-off means the laptop can no longer author secret vars (a re-key flow, or a Tier-3 event?).
  • Should the app place it somewhere app-scoped instead (e.g. SOPS_AGE_KEY_FILE under the state dir) so custody follows the app's existing discipline?

Evidence

  • Fault: founding: stand up the local VM: clan: disk on gateway: the disk could not be laid out: … No SOPS key found.
  • The last working repo's vars: vars/per-machine/gateway/state-version/version/value only — public, no sops needed.
  • Machine state after unblock: key at ~/.config/sops/age/keys.txt, sops/users/operator committed in the live config repo.
## The clean-install drive found it (2026-08-06) Ben's true-clean drive (no state dir, no Nix, no `~/.config/sops`) failed the private path's enroll leg at disk layout with, at the bottom of the honest error: ``` No SOPS key found. Please generate one with `clan secrets key generate`. ``` ## Why every clean machine will hit this The fleet-seeding arc deliberately made kanidm's TLS `ca` var **SECRET** (ADR 0105; STATUS names it as the fourth spike delta — a public var's `.path` needs the file on disk at eval time, which the install stage's generate step hasn't run yet). Secret clan vars are sops-encrypted, which requires: 1. an operator **age key** at `~/.config/sops/age/keys.txt` (`clan secrets key generate`), and 2. that key registered as a sops **admin user in the config repo** (`clan secrets users add operator --age-key <pub>` — writes `sops/users/operator`). Nothing in the app performs either step. Every drive before this arc passed because the repo's vars were public-only (`state-version`); every truly clean machine now fails at enroll, with the sops line buried under `clan: disk on gateway: the disk could not be laid out`. The live drive was unblocked manually with exactly those two commands (pinned clan CLI from the store); the key + `sops/users/operator` now exist on benz-HP. ## What the fix owns The private path is app-managed clan end-to-end (ADR 0125) — the app must own this bootstrap too. Likely shape: the seed leg (or the enrollment install stage's opening, next to `vars generate`) ensures the key exists and the operator user is registered, through the pinned CLI, fail-loud on either step (ADR 0100). Idempotent: both steps are no-ops when already present. ## The custody ruling this needs (why ready-for-human) The age private key is crown-jewel-adjacent — whoever holds it can decrypt every secret var in the config repo: - Does the **S12 scrub** remove it (like the community-CA home) or is it designed residue (like the guest-trust key)? It lives OUTSIDE the app's state dir, in the operator's own `~/.config/sops` — scrubbing a shared-tool location the operator may also use for other clans needs care. - Does the **recovery kit** carry it? Losing it after hand-off means the laptop can no longer author secret vars (a re-key flow, or a Tier-3 event?). - Should the app place it somewhere app-scoped instead (e.g. `SOPS_AGE_KEY_FILE` under the state dir) so custody follows the app's existing discipline? ## Evidence - Fault: `founding: stand up the local VM: clan: disk on gateway: the disk could not be laid out: … No SOPS key found.` - The last working repo's vars: `vars/per-machine/gateway/state-version/version/value` only — public, no sops needed. - Machine state after unblock: key at `~/.config/sops/age/keys.txt`, `sops/users/operator` committed in the live config repo.
Author
Owner

Ben ruled the custody questions (2026-08-06, ready-for-human sweep):

  1. App-scoped key — the app places the age key under its own state dir and points the pinned CLI at it via SOPS_AGE_KEY_FILE; the operator's shared ~/.config/sops is never touched.
  2. S12 scrub keeps it — designed residue (like the guest-trust key): the laptop stays able to author secret config after hand-off. A full app reset removes it with the state dir.
  3. The recovery kit carries a copy — key loss must not orphan the community's secret config; the kit is already the crown-jewel envelope.

Build shape as specced in the body: seed leg (or enroll install-stage opening, next to vars generate) ensures key + sops/users/operator registration through the pinned CLI, idempotent, fail-loud (ADR 0100). Migration note: benz-HP's manual unblock left a key at the clan-default ~/.config/sops/age/keys.txt — the fix should adopt/import an existing registered key rather than minting a second admin blindly.

Flipped ready-for-agent.

Ben ruled the custody questions (2026-08-06, ready-for-human sweep): 1. **App-scoped key** — the app places the age key under its own state dir and points the pinned CLI at it via `SOPS_AGE_KEY_FILE`; the operator's shared `~/.config/sops` is never touched. 2. **S12 scrub keeps it** — designed residue (like the guest-trust key): the laptop stays able to author secret config after hand-off. A full app reset removes it with the state dir. 3. **The recovery kit carries a copy** — key loss must not orphan the community's secret config; the kit is already the crown-jewel envelope. Build shape as specced in the body: seed leg (or enroll install-stage opening, next to `vars generate`) ensures key + `sops/users/operator` registration through the pinned CLI, idempotent, fail-loud (ADR 0100). Migration note: benz-HP's manual unblock left a key at the clan-default `~/.config/sops/age/keys.txt` — the fix should adopt/import an existing registered key rather than minting a second admin blindly. Flipped `ready-for-agent`.
Author
Owner

Fixed on origin/main in 6fa4d77.

The app now owns the sops-admin bootstrap on the private path (app-managed clan end-to-end, ADR 0125), so a clean machine no longer fails enroll at disk-layout with No SOPS key found.

Shape (per Ben's 2026-08-06 custody ruling):

  • New clan Secrets().EnsureOperator seam (internal/clan/secrets.go): ensures an app-scoped age key (<state-dir>/sops/age/keys.txt, pointed at via SOPS_AGE_KEY_FILE on the pinned-CLI env — clan.ExecEnv) and registers sops/users/operator through the pinned CLI inside the single-writer commit. Idempotent (tree/file presence) and fail-loud (ADR 0100).
  • Adopts an existing key at the clan/sops default (the benz-HP hand-unblock) rather than mint a second admin — reads the public key from the key file's own # public key: header.
  • founding.StandUpPrivate runs it after the ADR 0125 toolchain gate and before the VM enrollment reaches secret-var sealing (ClanFace/clan.Clan/the fake/the resting stub gain Secrets()).
  • Custody: the key is designed residue the S12 scrub keeps and a full app reset removes with the state dir (it lives under the state dir, ADR 0121 — never a crown jewel, ADR 0044). The recovery-kit-carries-a-copy behaviour is a note for the still-unwired hand-off/laptop slice (wiring_prod.go:143-145); placing the key under the state dir gives the scrub/reset behaviour for free.

Tests: the clan CLI seam (a scripted secrets double + a real config repo — mint→register, adopt-existing, idempotent no-op, fail-loud, ExecEnv override) and the founding gate (the bootstrap runs; its failure gates the VM before any stand-up). go build/vet/test + golangci-lint green (pre-push gate).

Lab-pending (next clean drive): the exact clan secrets key generate write-location behaviour (does it honour SOPS_AGE_KEY_FILE?) and the secrets users add flag shape are proven against the pinned CLI on the next real drive (the private-path arc's lab discipline); the belt-and-braces adopt relocates the key app-scoped either way. Evidence: internal/clan/secrets_test.go.

Fixed on `origin/main` in `6fa4d77`. The app now owns the sops-admin bootstrap on the private path (app-managed clan end-to-end, ADR 0125), so a clean machine no longer fails enroll at disk-layout with `No SOPS key found`. **Shape (per Ben's 2026-08-06 custody ruling):** - New clan `Secrets().EnsureOperator` seam (`internal/clan/secrets.go`): ensures an **app-scoped** age key (`<state-dir>/sops/age/keys.txt`, pointed at via `SOPS_AGE_KEY_FILE` on the pinned-CLI env — `clan.ExecEnv`) and registers `sops/users/operator` through the pinned CLI inside the single-writer commit. Idempotent (tree/file presence) and fail-loud (ADR 0100). - **Adopts** an existing key at the clan/sops default (the benz-HP hand-unblock) rather than mint a second admin — reads the public key from the key file's own `# public key:` header. - `founding.StandUpPrivate` runs it **after** the ADR 0125 toolchain gate and **before** the VM enrollment reaches secret-var sealing (`ClanFace`/`clan.Clan`/the fake/the resting stub gain `Secrets()`). - **Custody:** the key is designed residue the S12 scrub keeps and a full app reset removes with the state dir (it lives under the state dir, ADR 0121 — never a crown jewel, ADR 0044). The recovery-kit-carries-a-copy behaviour is a note for the still-unwired hand-off/laptop slice (`wiring_prod.go:143-145`); placing the key under the state dir gives the scrub/reset behaviour for free. **Tests:** the clan CLI seam (a scripted `secrets` double + a real config repo — mint→register, adopt-existing, idempotent no-op, fail-loud, `ExecEnv` override) and the founding gate (the bootstrap runs; its failure gates the VM before any stand-up). `go build/vet/test` + golangci-lint green (pre-push gate). **Lab-pending (next clean drive):** the exact `clan secrets key generate` write-location behaviour (does it honour `SOPS_AGE_KEY_FILE`?) and the `secrets users add` flag shape are proven against the pinned CLI on the next real drive (the private-path arc's lab discipline); the belt-and-braces adopt relocates the key app-scoped either way. Evidence: `internal/clan/secrets_test.go`.
ben closed this issue 2026-08-07 00:19:01 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#313
No description provided.