fix(deploy): require OIDC signing-key vars; refuse to boot under a dev-* kid in prod #275
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
psa-systems/bunyip!275
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-258-drop-dev-signing-key-defaults"
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?
BUNYIP-258: compose.yml previously defaulted
OIDC_JWT_PRIVATE_KEY_PATH=/run/secrets/oidc/dev-2026.pemandOIDC_JWT_ACTIVE_KID=dev-2026. A fresh production deploy that forgot to override either env silently signed every id_token and at+jwt with a dev-named kid pointing at a dev key path. Downstream RPs would happily consumekid=dev-2026tokens because their JWKS lookup is keyed on whatever the OP advertises - the misconfiguration only surfaces when someone notices the kid name.Two defenses:
compose.yml: replace the defaults with${VAR:?message}socompose upaborts when either var is unset. Mirrors the BUNYIP-237 posture forBUNYIP_API_IMAGE/BUNYIP_WEB_IMAGE.bunyip-api/main.rs: panic at boot whenENVIRONMENT=productionandOIDC_JWT_ACTIVE_KIDstarts withdev-(case-insensitive). Catches the paste-error case where an operator filled the var with a leftover dev value..env.exampleupdated to document the new requirement.compose.dev.ymlsets both values explicitly (/run/secrets/oidc/dev-2026.pem,dev-2026) sojust devcontinues to work without any further change; the panic only fires underENVIRONMENT=production.#BUNYIP-258
BUNYIP-258: compose.yml previously defaulted `OIDC_JWT_PRIVATE_KEY_PATH=/run/secrets/oidc/dev-2026.pem` and `OIDC_JWT_ACTIVE_KID=dev-2026`. A fresh production deploy that forgot to override either env silently signed every id_token and at+jwt with a dev-named kid pointing at a dev key path. Downstream RPs would happily consume `kid=dev-2026` tokens because their JWKS lookup is keyed on whatever the OP advertises - the misconfiguration only surfaces when someone notices the kid name. Two defenses: - `compose.yml`: replace the defaults with `${VAR:?message}` so `compose up` aborts when either var is unset. Mirrors the BUNYIP-237 posture for `BUNYIP_API_IMAGE` / `BUNYIP_WEB_IMAGE`. - `bunyip-api/main.rs`: panic at boot when `ENVIRONMENT=production` and `OIDC_JWT_ACTIVE_KID` starts with `dev-` (case-insensitive). Catches the paste-error case where an operator filled the var with a leftover dev value. `.env.example` updated to document the new requirement. `compose.dev.yml` sets both values explicitly (`/run/secrets/oidc/dev-2026.pem`, `dev-2026`) so `just dev` continues to work without any further change; the panic only fires under `ENVIRONMENT=production`. #BUNYIP-258