self-hosted activation: confirm whether idm_admin desyncs across the second apply (value-vs-timing) — live-droplet forensic #640

Closed
opened 2026-08-21 22:36:53 +00:00 by ben · 1 comment
Owner

Confirm whether idm_admin actually desyncs across the second apply — value-vs-timing, live-droplet forensic (the deeper question #636 deferred)

ddbc3d13 explicitly closed only the named code gap in #636 ("a Begin-step lockout blindly submitted Cred into a dead session, 500ing instead of denying") and routed the deeper question here: why does founding's flip trigger a second switch-to-configuration, and does the idm_admin secret the app reads genuinely desync across it? This ticket carries that, plus new artifact forensics that falsify the original "the git secret rotates" framing and sharpen the experiment.

What the real drive's artifacts already prove (drive 20260821T070234Z, matou-workstation)

Two config-repo snapshots were captured (state/clan-config.pre-flip, state/clan-config):

  • kanidm-admins/idm_admin/secret = one commit (4ee8d3f 07:04:12), ciphertext blob byte-identical (1c2587a…) in both. The git secret does NOT rotate. GOTCHAS-#5 regenerate is not the mechanism.
  • Code: the app pointer (vmguest.go:171) and the provision block's idmAdminPasswordFile (vmguest.go:277) are the same path (kanidm-admins.files.idm_admin.path); e.idp = e.liveIDP (fleetwire/enrolment.go:105) is not memoized (re-reads the secret fresh over SSH each mint). No two-path divergence, no app-side stale cache.

The failure sequence (this drive predates #631/#633/#634/#635/#636 — all now landed)

logs/droplet-journal.txt:

  • Boot 1 kanidmd[1059] 07:07:51: recover-account → app auth Success, token 2e8ac70d. Control-plane binary absent (/srv/idss/bin/control-plane: No such file, exit 127) → this is why apply-2 exists (now fixed by #631).
  • Apply-2 switch-to-configuration 07:10:11 → kanidmd[5046] 07:10:13: recover-account revokes the app's boot-1 token (issuing credential no longer exists | session_id: 2e8ac70d); the box's own provision re-auths Success.
  • Control-plane restarts 07:10:14; its idm_admin auth is Denied - incorrect password ×3 (07:10:21/24/26) → Account temporarily locked / AU0001InvalidState 07:10:29 = the 500.

The unresolved question this ticket exists to settle

The box's own provision authed Success at 07:10:13, yet the app was denied incorrect password at 07:10:21 reading the same nominal secret. That is either:

  • (timing) a transient the now-landed #635 settle-retry + ddbc3d13 typed-denial already ride out — in which case a fresh drive on the new binary greens and this ticket closes; or
  • (value) a genuine divergence between the two on-box materializations of that one sops path across apply-1 (nixos-anywhere --extra-files install snapshot) vs apply-2 (sops-nix runtime decrypt) — which retry cannot fix and needs a materialization-layer fix.

Cheapest resolution: a verification drive on the new binary FIRST

Five activation fixes (#631/#633/#634/#635/#636) landed after the only self-hosted drive we have. Re-run the standing drive (#523) on ≥b78d7b8 before building lab tooling: green past activation ⇒ close this. Still red at the lockout with #635 in place ⇒ that run's forensics separate timing-vs-value directly.

If still red — the narrowed live experiment (from the 22:22Z session, confirmed correct)

Blank clan-lab create --fresh droplet (NOT the golden 3-VM snapshot — those are never nixos-anywhere-installed) + just clan.core.vars.generators.kanidm-admins (verbatim from vmguest.go kanidmGenerators(); default "services" phase IS in nixos-anywhere's pre-delivered set). clan machines install target then clan machines update target. Capture sha256sum + readlink -f of /run/secrets/vars/kanidm-admins/idm_admin after each apply. Same bytes ⇒ timing (land exponential backoff on #635's fixed-2s retry, which can feed kanidm's exponential soft-lockout). Different bytes ⇒ materialization fix. clan CLI is prebuilt at /nix/store/8wsdr1zjjlkd0m6d8xliw20nznh9nnay-clan-cli/bin/clan. NOTE: the standing drive cannot run from inside a ready-for-session session (host lock #577/ADR 0184) — use a dedicated host window or the separate clan-lab droplet.

ready-for-human: the remaining ask is a spend/approach call (run the verification drive; if red, spend a droplet on the experiment), not more of the code gap ddbc3d13 already closed.

## Confirm whether `idm_admin` actually desyncs across the second apply — value-vs-timing, live-droplet forensic (the deeper question #636 deferred) `ddbc3d13` explicitly closed only the **named code gap** in #636 ("a Begin-step lockout blindly submitted Cred into a dead session, 500ing instead of denying") and routed the deeper question here: *why does founding's flip trigger a second `switch-to-configuration`, and does the `idm_admin` secret the app reads genuinely desync across it?* This ticket carries that, plus new artifact forensics that **falsify the original "the git secret rotates" framing** and sharpen the experiment. ### What the real drive's artifacts already prove (drive `20260821T070234Z`, matou-workstation) Two config-repo snapshots were captured (`state/clan-config.pre-flip`, `state/clan-config`): - `kanidm-admins/idm_admin/secret` = **one commit** (`4ee8d3f 07:04:12`), ciphertext blob **byte-identical** (`1c2587a…`) in both. **The git secret does NOT rotate.** GOTCHAS-#5 regenerate is not the mechanism. - Code: the app pointer (`vmguest.go:171`) and the provision block's `idmAdminPasswordFile` (`vmguest.go:277`) are the **same** path (`kanidm-admins.files.idm_admin.path`); `e.idp = e.liveIDP` (`fleetwire/enrolment.go:105`) is **not memoized** (re-reads the secret fresh over SSH each mint). No two-path divergence, no app-side stale cache. ### The failure sequence (this drive predates #631/#633/#634/#635/#636 — all now landed) `logs/droplet-journal.txt`: - Boot 1 `kanidmd[1059]` 07:07:51: recover-account → app auth **Success**, token `2e8ac70d`. Control-plane binary absent (`/srv/idss/bin/control-plane: No such file`, exit 127) → *this is why apply-2 exists* (now fixed by #631). - Apply-2 `switch-to-configuration` 07:10:11 → `kanidmd[5046]` 07:10:13: recover-account **revokes the app's boot-1 token** (`issuing credential no longer exists | session_id: 2e8ac70d`); the box's own provision re-auths **Success**. - Control-plane restarts 07:10:14; its `idm_admin` auth is **`Denied - incorrect password`** ×3 (07:10:21/24/26) → **`Account temporarily locked`** / `AU0001InvalidState` 07:10:29 = the 500. ### The unresolved question this ticket exists to settle The box's own provision authed **Success at 07:10:13**, yet the app was denied **`incorrect password` at 07:10:21** reading the *same* nominal secret. That is either: - **(timing)** a transient the now-landed `#635` settle-retry + `ddbc3d13` typed-denial already ride out — in which case a fresh drive on the new binary greens and this ticket closes; or - **(value)** a genuine divergence between the two on-box materializations of that one sops path across apply-1 (`nixos-anywhere --extra-files` install snapshot) vs apply-2 (sops-nix runtime decrypt) — which retry cannot fix and needs a materialization-layer fix. ### Cheapest resolution: **a verification drive on the new binary FIRST** Five activation fixes (#631/#633/#634/#635/#636) landed *after* the only self-hosted drive we have. Re-run the standing drive (`#523`) on `≥b78d7b8` before building lab tooling: green past activation ⇒ close this. Still red at the lockout with `#635` in place ⇒ that run's forensics separate timing-vs-value directly. ### If still red — the narrowed live experiment (from the 22:22Z session, confirmed correct) Blank `clan-lab create --fresh` droplet (NOT the golden 3-VM snapshot — those are never `nixos-anywhere`-installed) + **just** `clan.core.vars.generators.kanidm-admins` (verbatim from `vmguest.go` `kanidmGenerators()`; default `"services"` phase IS in nixos-anywhere's pre-delivered set). `clan machines install target` then `clan machines update target`. Capture `sha256sum` + `readlink -f` of `/run/secrets/vars/kanidm-admins/idm_admin` **after each apply**. Same bytes ⇒ timing (land exponential backoff on `#635`'s fixed-2s retry, which can *feed* kanidm's exponential soft-lockout). Different bytes ⇒ materialization fix. `clan` CLI is prebuilt at `/nix/store/8wsdr1zjjlkd0m6d8xliw20nznh9nnay-clan-cli/bin/clan`. NOTE: the standing drive cannot run from inside a `ready-for-session` session (host lock #577/ADR 0184) — use a dedicated host window or the separate clan-lab droplet. `ready-for-human`: the remaining ask is a spend/approach call (run the verification drive; if red, spend a droplet on the experiment), not more of the code gap `ddbc3d13` already closed.
Author
Owner

Closing as moot — activation is proven clear (13/13 green)

Drive 20260822T002633Z ran the self-hosted journey GREEN end-to-end, all 13 legs — activation included. This ticket existed to settle the "value-vs-timing" question behind #636's activation 500. That question is now answered by a different finding, not the materialization desync this ticket hypothesised:

  • The git secret was proven stable (this ticket's premise).
  • The real cause was #641 — ExecRunner.Run swallowing an SSH Warning: Permanently added… (from #633's host-key rotation) into the exact-match idm_admin password via CombinedOutput(). Fixed in bd353b3 (stdout/stderr split).
  • With that fixed, activation passes cleanly and never reaches a lockout — so there is no residual materialization desync to chase. The narrowed live experiment is unnecessary.

No live-droplet forensic needed. Closing.

## Closing as moot — activation is proven clear (13/13 green) Drive `20260822T002633Z` ran the self-hosted journey **GREEN end-to-end, all 13 legs** — activation included. This ticket existed to settle the "value-vs-timing" question behind #636's activation 500. That question is now answered by a different finding, not the materialization desync this ticket hypothesised: - The git secret was proven stable (this ticket's premise). - The real cause was **#641** — `ExecRunner.Run` swallowing an SSH `Warning: Permanently added…` (from #633's host-key rotation) into the exact-match idm_admin password via `CombinedOutput()`. Fixed in `bd353b3` (stdout/stderr split). - With that fixed, activation passes cleanly and never reaches a lockout — so there is no residual materialization desync to chase. The narrowed live experiment is unnecessary. No live-droplet forensic needed. Closing.
ben closed this issue 2026-08-22 00:42:34 +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#640
No description provided.