identity: the forge host's own Google identity (Authentik client -> WIF, no key file) #55

Merged
founder merged 1 commit from identity/forge-host-wif into main 2026-08-16 11:19:46 +00:00
Owner

KSE-0182 A.2 phase 1 host leg: Authentik forge-host client-credentials provider + agenix client id/secret; google-wif-credentials.service/timer writing /run/google-wif/{subject-token,credentials.json} (direct principal, no SA impersonation) with a mode that performs the STS exchange; authentik-forge-host WIF provider in infra/identity. Sequence: merge -> forge switch (creates the Authentik app) -> identity apply (Google fetches the issuer discovery doc) -> on the forge. Verified: dry-activate builds; tofu fmt/validate clean; forge key decrypts the new secrets.

KSE-0182 A.2 phase 1 host leg: Authentik forge-host client-credentials provider + agenix client id/secret; google-wif-credentials.service/timer writing /run/google-wif/{subject-token,credentials.json} (direct principal, no SA impersonation) with a mode that performs the STS exchange; authentik-forge-host WIF provider in infra/identity. Sequence: merge -> forge switch (creates the Authentik app) -> identity apply (Google fetches the issuer discovery doc) -> on the forge. Verified: dry-activate builds; tofu fmt/validate clean; forge key decrypts the new secrets.
identity: the forge host's own Google identity (Authentik client -> WIF, no key file)
Some checks failed
Infra: Cloud OpenTofu / Infra (Cloud OpenTofu) (push) Successful in 47s
Deploy: Web / Deploy (Web) (push) Successful in 2m14s
Release: If Needed / Check (Release Needed) (push) Has been cancelled
Deploy: API / Deploy (API) (push) Has been cancelled
070c707104
KSE-0182 Amendment A.2, phase 1 host leg.

- Authentik: a `forge-host` client-credentials provider/application
  (key.store Forge Host; subMode user_username; 1 h tokens; no redirect
  URIs), declared next to the existing namespace/cloud-signing machine
  providers. Client id + secret minted into agenix
  (secrets/forge/wif-client-{id,secret}.age; founder + forge recipients).
- Scripts/forge-google-wif-credentials.sh: `refresh` mints the Authentik
  token with the release lanes' stdlib helper and writes
  /run/google-wif/subject-token (0640 root:google-wif) + credentials.json
  (Google external_account, credential_source.file, direct principal, no
  service-account impersonation); `check` additionally performs the STS
  exchange and fails if federation does not work -- the phase-1 host exit
  criterion.
- Nix: users.groups.google-wif; google-wif-credentials.service + timer
  (OnBootSec 3m, every 20 min, after authentik-key-store-ready); agenix
  secrets forgeHostOidcClient{Id,Secret}. Consumers (OpenBao seal, Garage
  GCS leg) attach in phase 2/4 via GOOGLE_APPLICATION_CREDENTIALS +
  SupplementaryGroups=google-wif.
- infra/identity/wif.tf: provider authentik-forge-host in the pool (issuer
  https://idp.key.store/application/o/forge-host/, allowed_audiences =
  client id, condition azp == client id, constant attribute.authority
  "forge-host"); output google_wif_forge_host_principal for the seal-key /
  bucket IAM bindings that follow. Google fetches the issuer discovery
  document at create time, so: forge switch first, then identity apply.

Verified: nixos-rebuild dry-activate builds; the OIDC-applications config
carries the forge-host provider; forge key decrypts both new secrets;
tofu fmt/validate clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
founder deleted branch identity/forge-host-wif 2026-08-16 11:19:46 +00:00
Author
Owner

Phase 1 host leg — proven (2026-08-16 11:44Z).

  • #55 (this) + #57 (Authentik 2026.5 creates providers with no allowed grant types unless the API payload sets them → Invalid grant_type for provider; sync gained grantTypes, forge-host = client_credentials; timer OnActiveSec so s-t-c can never run it inside the activation window) + #60 (the Nix spec builder had dropped grantTypes).
  • Forge on 46c39e1a (deploy runs 17253/17269 green). Provider 29 grant_types = {client_credentials}. google-wif-credentials.service succeeds: token iss=…/application/o/forge-host/ aud=azp=key-store-forge-host sub=ak-key.store Forge Host-client_credentials, /run/google-wif/{subject-token 0640 root:google-wif, credentials.json}.
  • identity apply 17271 (on the job token): authentik-forge-host provider created.
  • On the forge: forge-google-wif-credentials.sh check → STS exchange ok: token_type=Bearer expires_in=3596s — the host federates into Google with no key file. Phase 1 exit criteria (A.5) both met.

Next (phase 2): seal key + host IAM in infra/identity (Google-only stack; infra/openbao cannot run before OpenBao is up), OpenBao unit fixes (postgres group, GOOGLE_APPLICATION_CREDENTIALS, ordering), init with recovery keys to the founder offline, then bootstrap infra/openbao from the forge.

**Phase 1 host leg — proven (2026-08-16 11:44Z).** - #55 (this) + #57 (Authentik 2026.5 creates providers with **no** allowed grant types unless the API payload sets them → `Invalid grant_type for provider`; sync gained `grantTypes`, forge-host = `client_credentials`; timer `OnActiveSec` so s-t-c can never run it inside the activation window) + #60 (the Nix spec builder had dropped `grantTypes`). - Forge on `46c39e1a` (deploy runs [17253](https://git.key.store/key-store/key.store/actions/runs/17253)/[17269](https://git.key.store/key-store/key.store/actions/runs/17269) green). Provider 29 `grant_types = {client_credentials}`. `google-wif-credentials.service` succeeds: token `iss=…/application/o/forge-host/ aud=azp=key-store-forge-host sub=ak-key.store Forge Host-client_credentials`, `/run/google-wif/{subject-token 0640 root:google-wif, credentials.json}`. - identity apply [17271](https://git.key.store/key-store/key.store/actions/runs/17271) (on the job token): `authentik-forge-host` provider created. - On the forge: `forge-google-wif-credentials.sh check` → **`STS exchange ok: token_type=Bearer expires_in=3596s`** — the host federates into Google with no key file. Phase 1 exit criteria (A.5) both met. Next (phase 2): seal key + host IAM in `infra/identity` (Google-only stack; `infra/openbao` cannot run before OpenBao is up), OpenBao unit fixes (postgres group, `GOOGLE_APPLICATION_CREDENTIALS`, ordering), init with recovery keys to the founder offline, then bootstrap `infra/openbao` from the forge.
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!55
No description provided.