Node bootstrap identity: AppRole + response-wrapped SecretID minted at image build #3
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lab/machine-configs#3
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?
Part of lab/machine-configs#7. Rewritten 2026-11-05: the original R6/R8 plan (sops identity from baked host keys, rke2 apiserver CA via sops) is superseded by OpenBao.
Design
secret_id_bound_cidrs), revocable centrally.Done when
LOE estimate: 3–5 days (split into two independent halves)
R6 half — ~1 day, independent, start now
sops.age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"]inmodules/base.nixis a one-liner.installer-<host>configs already embed the closure (flake.nixmkInstaller); extendingmodules/installer.nixto also drop the pre-generated/etc/ssh/ssh_host_ed25519_keyinto the ISO is the delta. Accept the documented trade-off: whoever holds the ISO holds the host key.task vm-run→ boot installed disk): first boot should decrypt sops offline with zero manual key injection — that's the R6 acceptance box, and the VM harness we already have makes it testable.R7/R8 half — ~2–4 days, depends on iac#40 (Vault CA)
secrets/<cluster>.sops.yamlasapiserver-ca/apiserver-ca-crt— a human/Vault-IaC step, not per-host code.modules/rke2.nixmust lay the CA material into/var/lib/rancher/rke2/server/tls/(server-ca.key,server-ca.crt+ support files) beforerke2-serverstarts. This means either apreStart/ordering unit in therke2-${role}service (rke2.nix:154) or extendingrke2-install.service(rke2.nix:175) — needs a careful look at rke2's actual TLS layout so the first server bootstraps with the shared CA rather than generating its own (the exact thing R7 warns about). Realistically this needs one boot-test iteration to confirm.R9 note (deploy key) — small, but flagging a mismatch
pull.nix).modules/base.nixsetsdeploy.flakeUrl = git+ssh://git@git.animeteamspeak.moe/ginjiruu/machine-configs(base.nix:82), but the actual repo/remote islab/machine-configs. The flake URL must be updated ornixos-pullwill fail on the timer. Worth fixing in the same change.Recommendation: start the R6 half now; hold R7/R8 until iac#40.
003 — R6/R8: first-boot sops identity + build-time key pre-generationto Node bootstrap identity: AppRole + response-wrapped SecretID minted at image build2026-11-11 progress.
Built:
modules/openbao-agent.nix(c0b2edb), enabled on think-01..03 + pi-01..04 via profiles-think-node. openbao-identity unwraps the wrapped SecretID once, keeps it 0400, deletes the wrapping file. INCIDENT only when OpenBao rejects the token (used/expired/revoked). Unreachable or TLS trouble is a retry and leaves the token unused. Not enrolled = ExecCondition skip, never a failed unit (a failed unit at switch time would trip deploy-revert). openbao-render runs bao agent once (exit_after_auth, exit_on_err) from a timer, not during switch, so an OpenBao outage can't roll a deploy back.task bao:enroll HOST=<h> [FORCE=1]mints the wrapped SecretID with the admin's login and pipes it over ssh stdin.Rolled out: all 7 hosts show the timer armed, identity skipped with the enroll hint, 0 failed units.
Not yet: enrolling the 7 hosts (needs an admin login), image-build minting (installer/SD path, with #13), mini-01/game-01 (not on comin yet; their machine-configs IPs aren't what OpenBao sees).
2026-11-11: all 7 comin hosts enrolled (
task bao:enroll HOST=<h> FORCE=1, nowscripts/bao-enroll.sh).Verified on every host:
/var/lib/openbao-agent/secret-id0400, no wrapping file left,/run/openbao-agent/identity= its own role name, 0 failed units, render timer active. A second login from the kept SecretID (pi-03, identity file removed first) re-rendered with result=success.The first enrollment attempt died after minting: Task's shell strips backslash escapes even in quoted heredocs. Its SecretIDs on think-01/02 were destroyed by
--force; the wrapping tokens never left the workstation and expired unread.Done-when status: