Move Keycloak to its own user and PostgreSQL #670
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#670
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "%!s()"
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?
Move Keycloak to its own rootless user
bitborg-idand its own PostgreSQL, as decided in ADR 0042 (bitborg-docs#147, #148). Keycloak cut over on 2026-10-11 under the shared user and the shared Postgres. Until the move, a container escape on the shared user reaches the Keycloak database password.10.90.0.1, networks (#661). Applied and reboot-tested on staging. Applied on prod 2026-10-11 with #677.10.90.0.1:8080and:9000. Point Caddy,keycloak_internal_urland vmagent at it. Proves the network path on staging before any user move. Also pin thebitborg-id-datasubnet.bitborg-id:keycloak-postgres, secrets,keycloak_restore_from, cleanup of the old unit. One PR. Staging migration by dump and restore.bitborg-id, handoff to the hot and daily backups, verify and drill decrypt it.keycloakdatabase and role from the shared Postgres.Done when: prod Keycloak runs as
bitborg-idon its own PostgreSQL, the drill restores it, and the shared Postgres has nokeycloakdatabase.PR 3 (#677) applied, 2026-10-11.
Staging (18:27 UTC):
bitborg-id-datarecreated with the pinned10.89.11.0/24. Caddy and web reach Keycloak on10.90.0.1, sign-up and sign-in work, the session records the real client IP. Second--checkchanged=0.Prod (19:38 UTC): the apply also brought #661 (user
bitborg-id, subordinate IDs231072:65536, data bind mount,10.90.0.1onlo,user@2001drop-in). Reconciled clean, second--checkchanged=0.up{job="keycloak",instance="10.90.0.1:9000"}is 1, all blackbox probes 1, sign-in works and the session records the real client IP. OnlyWatchdogfires.Next: PR 4.
Correction to the prod note above: the PR 3 apply was scoped to
podman,keycloak,web,billing,caddy,monitoring-agent, so thebaserole was not in it and the second--checkdid not cover it. Prod is missing theip daddr 10.90.0.1 droprule from #661. Exposure is nil today: the input chain policy is drop and only 22, 80, 443 and the allowlisted 2222 are open. The next prod apply (PR 4, withbase) adds the rule.PR 3 (#677) and PR 4 (#687) are live on staging and prod. Next: PR 5, the Keycloak role under
bitborg-idwith its own Postgres.Status 2026-10-14.
bitborg-idsubnet, but rootlessport connects from itsbitborg-id-dataaddress. Fixed in #750, applied on staging.LOGINevents now show the real client IP.bitborg-20261014T153837Z, which carrieskeycloak.dump.age. The dump decrypts and restores.keycloak_isolated: trueplus the vault password). Apply on 2026-10-15 per the runbook "Move Keycloak to bitborg-id": fresh verify, dry-run, apply, counts, reboot, sign-in check. Merge after the apply.Applied on prod 2026-10-15 from #752. Counts matched before and after (users, groups, clients, credentials). The health gate passed, the reboot came back clean, and the LOGIN session shows the real client IP. The dump hand-off is owned by bitborg-id. The shared keycloak database stays as the rollback copy until the purge (#585).