fix(infra): M8 audit batch 1 — IdP credential parameterization, bootstrap gate, OTP redaction, compose hardening (#214) #216

Merged
amiryahaya merged 1 commit from fix/m8-audit-infra into main 2026-11-17 13:37:47 +01:00
Owner

M8-close audit remediation batch 1 (#214 findings M8-1, M8-7, M8-8 + L8).

M8-1 (live-credential): deploy/idp/steps.yaml shipped the live IdP admin password (ChangeMe1!, no change required) in a repo linked from security.txt. The password now arrives via ZITADEL_FIRSTINSTANCE_ORG_HUMAN_PASSWORD_PASSWORD from idp/.env (required at boot), PasswordChangeRequired flips to true.

⚠️ OPERATOR ACTION REQUIRED (cannot be done from a PR): on the LIVE idp.failsulit.com the init step is a no-op — rotate the admin password via the IdP console NOW, and set IDP_ADMIN_PASSWORD in idp/.env before the next recreate.

M8-7 (bootstrap race): /api/admin/bootstrap/setup|confirm were public until a SuperAdmin exists — first scanner to complete the flow owns the deployment (staging bootstrap is still pending). Both are now gated on Bootstrap:Enabled=true (default OFF); 404 when disarmed; status stays read-only. Deploy note: arming step added to deployment-guide §11.

M8-8 (OTP oracle): NullEmailService logged registration/TOTP-recovery OTP codes at INFO into rotating log files (email-disabled mode is documented and staging runs it). Codes are no longer logged.

L8: compose api service gains a curl /health healthcheck (crash-looping API previously showed running); compose.local postgres binds to 127.0.0.1.

Also updates deployment-guide §11 + the Sessions sample (ChallengeTtlMinutes 10, MaxPerAccount — see #212-campaign PR-2).

Tests: BootstrapGateTests (3 new: disabled-404 ×2, read-only status) + BootstrapTests green; full suite 1085 green.

Part of the M8-close FIX-ALL (umbrella #215, audit #214).

M8-close audit remediation batch 1 (#214 findings M8-1, M8-7, M8-8 + L8). **M8-1 (live-credential)**: deploy/idp/steps.yaml shipped the live IdP admin password (`ChangeMe1!`, no change required) in a repo linked from security.txt. The password now arrives via `ZITADEL_FIRSTINSTANCE_ORG_HUMAN_PASSWORD_PASSWORD` from idp/.env (required at boot), `PasswordChangeRequired` flips to true. ⚠️ **OPERATOR ACTION REQUIRED (cannot be done from a PR)**: on the LIVE idp.failsulit.com the init step is a no-op — rotate the admin password via the IdP console NOW, and set `IDP_ADMIN_PASSWORD` in idp/.env before the next recreate. **M8-7 (bootstrap race)**: `/api/admin/bootstrap/setup|confirm` were public until a SuperAdmin exists — first scanner to complete the flow owns the deployment (staging bootstrap is still pending). Both are now gated on `Bootstrap:Enabled=true` (default OFF); 404 when disarmed; status stays read-only. **Deploy note: arming step added to deployment-guide §11.** **M8-8 (OTP oracle)**: NullEmailService logged registration/TOTP-recovery OTP codes at INFO into rotating log files (email-disabled mode is documented and staging runs it). Codes are no longer logged. **L8**: compose api service gains a curl /health healthcheck (crash-looping API previously showed running); compose.local postgres binds to 127.0.0.1. Also updates deployment-guide §11 + the Sessions sample (ChallengeTtlMinutes 10, MaxPerAccount — see #212-campaign PR-2). Tests: BootstrapGateTests (3 new: disabled-404 ×2, read-only status) + BootstrapTests green; full suite 1085 green. Part of the M8-close FIX-ALL (umbrella #215, audit #214).
fix(infra): M8 audit batch 1 — IdP credential parameterization, bootstrap gate, OTP redaction, compose hardening (#214)
All checks were successful
Security CI / security-scan (pull_request) Successful in 2m7s
API CI / migrations (pull_request) Successful in 5m17s
API CI / build-and-test (pull_request) Successful in 16m44s
41cc78cb8e
M8-1: the live IdP admin password shipped as a committed constant
(ChangeMe1!, no change required) in deploy/idp/steps.yaml — the repo is
linked from security.txt. The password now arrives via
ZITADEL_FIRSTINSTANCE_ORG_HUMAN_PASSWORD_* env vars from idp/.env
(required), PasswordChangeRequired flips to true, and steps.yaml carries
a rotation note (init step is no-op after first boot — rotate via the
IdP console on existing installs; operator action required).

M8-7: /api/admin/bootstrap/setup|confirm were public until a SuperAdmin
exists — first network scanner to complete the flow owns the deployment
(the superadmin bootstrap is still pending on staging). Both endpoints
are now gated on Bootstrap:Enabled=true (default OFF in appsettings);
status stays read-only-open. FailSulitFactory arms tests; new
BootstrapGateTests pin the disabled-404 behavior (3 tests).

M8-8: NullEmailService logged registration/TOTP-recovery OTP codes at
INFO into rotating log files — email-disabled mode is documented and
staging runs it. Codes are no longer logged (Debug, redacted).

L8: compose api service gains a curl /health healthcheck (crash-looping
API previously showed 'running'); compose.local postgres binds to
127.0.0.1 instead of all interfaces.

Tests: BootstrapGateTests 3 + BootstrapTests 11 all green.
Sign in to join this conversation.
No description provided.