forge: TPM host identity (KSE-0182 Amendment B) — inert until the TPM is enabled #124

Merged
founder merged 1 commit from forge/tpm-host-identity into main 2026-08-17 01:15:06 +00:00
Owner

TPM key oneshot + JWK export, TPM-signed JWTs for Google STS and OpenBao login, tofu provider/backend gated on empty vars, Nix wiring behind primary=false, forge-loss runbook. Dry-activate green; units conditioned on /dev/tpmrm0.

TPM key oneshot + JWK export, TPM-signed JWTs for Google STS and OpenBao login, tofu provider/backend gated on empty vars, Nix wiring behind primary=false, forge-loss runbook. Dry-activate green; units conditioned on /dev/tpmrm0.
forge: TPM host identity (KSE-0182 Amendment B) — inert until the TPM is enabled
Some checks failed
build-release.yml / forge: TPM host identity (KSE-0182 Amendment B) — inert until the TPM is enabled (push) Failing after 0s
build-release.yml / forge: TPM host identity (KSE-0182 Amendment B) — inert until the TPM is enabled (pull_request) Failing after 0s
Release: If Needed / Check (Release Needed) (push) Successful in 8s
Infra: Cloud OpenTofu / Infra (Cloud OpenTofu) (push) Successful in 43s
Deploy: API / Deploy (API) (push) Successful in 2m52s
Deploy: Web / Deploy (Web) (push) Successful in 3m25s
b025c52ada
nixos/modules/services/tpm-host-identity: an idempotent oneshot creates a
non-extractable RSA-2048 signing key in the TPM (owner hierarchy, auth-
only policy, NO PCR binding — updates cannot lock the seal), persists it
at 0x81000010 and publishes public.pem / jwk.json / jwks.json under
/run/tpm-forge-host; a second unit+timer mints the OpenBao login JWT
(aud https://vault.key.store) every 20 min, keep-on-failure. Both carry
ConditionPathExists=/dev/tpmrm0, so today's switch changes nothing at
runtime. Scripts: tpm-forge-host-{key,jwt,openbao-token}.sh, the JWK
exporter, a software-key self-test.

Scripts/forge-google-wif-credentials.sh gains --issuer authentik|tpm|auto:
in tpm mode the subject token is a TPM-signed JWT (iss https://git.key.
store/tpm-forge-host, sub forge-host) exchanged at STS BEFORE the live
files are replaced (a TPM signature is always well-formed; only Google
knows whether the JWK is applied), Authentik as fallback.

Tofu, gated on empty vars until the JWK/PEM are pasted: infra/identity
provider tpm-forge-host (inline jwks_json, subject == forge-host,
attribute.authority forge-host — the existing seal-key IAM stays);
infra/openbao jwt backend tpm-forge-host (static validation pubkey) +
role forge-host on policy key-store-forge-host.

Nix wiring behind services.key.store.tpmHostIdentity.primary (default
false): when flipped, google-wif-credentials no longer orders after
Authentik and runs in tpm mode, and the materializer logs in through
auth/tpm-forge-host with the TPM token — boot order Postgres → OpenBao →
materializer → Authentik → Caddy. Runbook docs/runbooks/openbao-forge-
loss.md (what survives, new box, scratch-restore drill, revoke, cut-over
checklist).

Verified: shellcheck + self-test (RS256 verified with openssl over the
exact signing input), nix eval for primary=false/true, tofu fmt +
validate (empty and dummy vars), forge dry-activate green with the units
conditioned off. Not yet: hardware TPM operations, STS acceptance,
OpenBao login on the static-pubkey backend, drills (after the UEFI step).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
founder deleted branch forge/tpm-host-identity 2026-08-17 01:15:06 +00:00
Sign in to join this conversation.
No labels
No milestone
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
key-store/key.store!124
No description provided.