refactor(keycloak): drop the shared passphrase from the realm root #933
Inga granskare
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
priority
high
priority
low
priority
medium
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-infra!933
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "feat/realm-state-passphrase-cleanup"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
refactor(keycloak): drop the shared passphrase from the realm root
Stack:
feat/realm-state-passphrase, then this PR (2 of 3), thenfeat/realm-drift-check.Merge it only after every realm workspace is rewritten with its own passphrase (the steps in the
previous PR). Otherwise the realm state cannot be read.
What
encryption.tofu: only the realm key. The shared key provider, its method and bothfallbackblocks are gone.
variables.tofu:state_encryption_passphraseis gone from the realm root.scripts/keycloak-tofu-env.py: reads only the environment's own vault, so staging no longerneeds the prod vault. It never exports the main root's passphrase, and the self-test checks that.
The main root keeps
vault_opentofu_state_encryption_passphraseunchanged.Proof
The rewrite proof in the previous PR used this commit's
encryption.tofuandvariables.tofu, bytefor byte. A rewritten state reads with only
TF_VAR_realm_state_passphraseset, and a state not yetrewritten fails with
decryption failed for all.Operator steps
key_provider.pbkdf2.realm:jq -r '.meta | keys[]' opentofu/keycloak/terraform.tfstate.d/<env>/terraform.tfstate.eval "$(./scripts/keycloak-tofu-env.py <env>)"andtofu plan -detailed-exitcodemust exit 0 for staging and prod.Checks
tofu fmt -check,tofu validate,keycloak-tofu-env.py --self-test(9 pass), ruff 0.17.6,check-alert-rules.py,ansible-lint(production),site.yml --syntax-check, prettier,markdownlint.
Refs #576