From 8ed82987f92c6ab28448d9ef52df89028a78e73c Mon Sep 17 00:00:00 2001 From: Md Nurnobi Date: Mon, 23 Nov 2026 16:52:16 +0000 Subject: [PATCH] docs(oidc): complete P05-OIDC-09 read-only production preflight, release-blocker matrix and phased scopes --- docs/P05-OIDC-09.md | 47 ++++++++++++++++++++++++++ notes/P05-OIDC-09.md | 80 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 docs/P05-OIDC-09.md diff --git a/docs/P05-OIDC-09.md b/docs/P05-OIDC-09.md new file mode 100644 index 0000000..7d90e30 --- /dev/null +++ b/docs/P05-OIDC-09.md @@ -0,0 +1,47 @@ +# P05-OIDC-09 — Production Release Preflight (Read-only) + +**Verdict:** **Forensic documentation audit COMPLETE; production release remains BLOCKED / LIVE NOT VERIFIED.** Baseline `d3ee3fa4de62463c53d5213c532d097278f928c6`. Scope-first note committed before any other changes. No source edit, CI dispatch, local test, build, DNS/TLS query, VPS/Coolify/Cloudflare change, secret or production deployment in this phase. + +The existing accepted [Gitea Run #105](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/105) / Job #221 **SUCCESS** confirms a deliberately non-deployable synthetic Compose policy with **48/48 security-negative fixtures PASS** on source `daaa8b259a519ae0290ba28936ef2279b3a9172c`. [Run #99](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/99) **SUCCESS** confirms actual custom imported Login V2/Chromium/OIDC/Auth.js in **disposable HTTP localhost CI**. Neither certifies public production availability, image provenance, actual HTTPS, key custody, Console or MFA/SSO. + +## Production configuration: what exists versus what does not + +| Area | Current evidence | Operator disposition | +| --- | --- | --- | +| ZITADEL + Postgres + Traefik | `deployment/docker/compose.backend.dev.yaml` references Go ZITADEL v4.20.4, PostgreSQL 17.10-alpine and Traefik 3.7.7; localhost HTTP and dev first-admin/PAT | **SOURCE VERIFIED / dev CI verified**. Never deploy this developer Compose as-is; official Go is not vendored or release-pinned by digest | +| Imported Login V2 | `auth/ui/v2/` source tag v4.20.4; temporary custom source-built Run #99 OIDC PASS, image removed | **CI VERIFIED disposable; production image BLOCKED**. Reproducible/digest-pinned, signed/safe artifact not published | +| Account Portal | `users/ui/` Auth.js confidential OIDC, HTTPS-origin validation, PKCE/state/nonce, protected session/API and local logout; `package-lock.json` **exists**; no Account OCI Dockerfile in tracked tree | **SOURCE + historic CI VERIFIED; production packaging BLOCKED**. Automatic token refresh/global logout and portal-native factor management not implemented | +| Synthetic static contract | `deployment/production-contract/**` and manual `.gitea/workflows/p05-production-contract-dry-run.yml` | **CI VERIFIED only**. Images are `synthetic.invalid`, replicas zero; never `compose up` | +| Actual public issuer, Account callback and cookies | Target `https://auth.vib.tools`, separate `https://account.vib.tools`, exact `/api/auth/callback/zitadel` | **LIVE NOT VERIFIED / BLOCKED**; no real DNS/certificate/client registration/cookie security evidence | +| Masterkey/PAT/first admin/IAM_OWNER | `notes/P05-OIDC-07.md` proposes 32-byte ZITADEL master key, vault+break-glass, least-privilege service credentials | **DESIGN ONLY / BLOCKED**; no real custody, rotation or tested emergency recovery | +| Encrypted database backup/rollback | Dev named volumes, ephemeral CI persistence/cleanup | **BLOCKED**; encrypted offsite backup, matching-key escrow, PITR and isolated restore unverified | +| Console/MFA/passkey/SMTP/second SaaS SSO | Imported UI routes and central identity self-service links | **SOURCE VERIFIED UI; LIVE NOT VERIFIED**. No real Console human, WebAuthn factor, recovery, second client or federated logout acceptance | +| Monitoring/controlled release | Dev healthchecks and CI cleanup; no production signed release workflow | **BLOCKED**; alerts, RPO/RTO, immutable artifact release, rollback and incident drill missing | + +## Canonical deployment target — design, not live + +**Issuer:** `https://auth.vib.tools` on TLS 443. Route `/ui/v2/login/**` to private Login V2 HTTP port 3000, `/ui/console/**` and the default remaining ZITADEL API/discovery to private Go port 8080 **h2c/HTTP2** (gRPC-Web as required). Trusted edge rejects unknown SNI/Host and rewrites, never trusts user-supplied `Forwarded`/`X-Forwarded-*`. No publicly bound DB 5432/API 8080/Login 3000 on either IPv4 or IPv6. **Account:** `https://account.vib.tools`, separate HTTPS origin, exact confidential OIDC callback `https://account.vib.tools/api/auth/callback/zitadel`. Check real production Secure/HttpOnly/SameSite host-scoped cookies; stage HSTS only after all domain/certificate recovery gates. + +## Operator stop gates and recovery + +**DO NOT CUT OVER** if image source/digest/SBOM/signature and current advisories are not acceptable, master key/PG encrypted backup and matching-key restore not rehearsed, independent `IAM_OWNER` break-glass unavailable, real Console human access unverified, edge Host/forwarding/h2c/callback tests fail, any API/DB port public, cert renewal unmanaged, first-admin policy/SMTP recovery absent, signed rollback digest lost or monitoring unready. Never replace a persistent database or regenerate an existing master key as a rollout convenience. Keep old image digest/route, reversible migration or validated recovery point, operator-owned rollback decision and audit trail. No actual rollback was performed here. + +## Minimal independent phase order + +1. **P05-OIDC-10:** CI-only imported Login OCI provenance and pinned build evidence, no registry/production. +2. **P05-OIDC-11:** Account OCI packaging and frozen-lock CI provenance separately. +3. **P05-OIDC-12:** Official Go/PG/Traefik digest + CVE/compatibility review. +4. **P05-OIDC-13:** Attested/signed release + **non-production** registry publish separately from live deploy. +5. **P05-OIDC-14:** Master key/secret custody + least-privilege IAM_OWNER emergency contract, never expose user PAT. +6. **P05-OIDC-15:** Encrypted PostgreSQL backup, matching-key isolated restore, RPO/RTO and rollback. +7. **P05-OIDC-16:** Approved private production runtime, health/alerts/rollback foundation, no public ingress. +8. **P05-OIDC-17:** Separately approved real DNS/TLS issuer, trusted h2c/Host ingress and callback test. +9. **P05-OIDC-18:** Real Admin Console, IAM_OWNER recovery and gradual LoginV2 canary cutover. +10. **P05-OIDC-19:** Real HTTPS Account OIDC/cookies/protected API/redirect negatives. +11. **P05-OIDC-20:** MFA/passkey/SMTP enrollment and recovery. +12. **P05-OIDC-21:** Second independent SaaS OIDC client/SSO and logout semantics. +13. **P05-OIDC-22:** Final operator-authorized release go/no-go, incident/rollback acceptance. + +Each future phase is **proposed, NOT APPROVED**, with its own pre-source note/Scope Lock, exact path allowlist, independent CI/live safety acceptance and rollback. Do not combine protected secrets, registry publishing, DNS and real deployment into a single phase. Source and release details, exact risks and recommended next phase Scope Lock: [notes/P05-OIDC-09.md](../notes/P05-OIDC-09.md). + +**Next separate approval recommendation:** `P05-OIDC-10`, a disposable Gitea-only Login image provenance gate with narrowly scoped new helper/workflow, no vendor source edit, registry push, real secrets, deployment, tags or release. No approval implied by this document. diff --git a/notes/P05-OIDC-09.md b/notes/P05-OIDC-09.md index 50f3bd6..400fb8e 100644 --- a/notes/P05-OIDC-09.md +++ b/notes/P05-OIDC-09.md @@ -25,4 +25,82 @@ Prepare a conservative release blocker/stop-condition matrix, dependency sequenc After read-only source audit, create `docs/P05-OIDC-09.md` with source-grounded operator release preflight; expand this note with factual findings, exact file references, accepted CI refs, an ordered plan and a ready-to-copy next approval. Synchronize pertinent existing `notes/project/docs` documentation and associated README/MINIFEST; reconcile exact Git-tracked inventory (expected 793 only if exactly these two new notes/docs files). Perform ONE focused cumulative baseline-to-HEAD documentation/security/scope audit, ensure zero protected file changes and no credential exposure, commit all documentation to Gitea main and verify final main SHA. CI source SHA and final docs SHA must remain separate. If any evidence is missing, record UNKNOWN/BLOCKED without guessing. -**Before any other document edit:** only this Scope Lock has been committed; no app/infra action, new CI run or live verification has been performed. +## P05-OIDC-09 completed read-only forensic audit — source, acceptance and production boundaries + +**Audit date:** 2026-11-23. **Pre-other-docs Scope Lock commit:** `e30b288fc19922e92b64f538af4c00a910654212`. Baseline `d3ee3fa4de62463c53d5213c532d097278f928c6` had **791 tracked files**, no truncated tree. This phase examined read-only tracked source/documents, existing Gitea Run #105/job #221 and Run #99; **did not** inspect or modify live servers/DNS/TLS/secrets, perform local tests, start containers or dispatch any CI. + +### Evidence classification policy + +**SOURCE VERIFIED** = exact files/behavior configured or present in this repository, not demonstrated running in production. **CI VERIFIED** = actual historical Gitea jobs successfully ran their own explicitly described disposable checks, not public production. **LIVE NOT VERIFIED** = current public/production evidence unavailable, NOT a claim that the external service does not exist. **BLOCKED** = mandatory release safety/control not implemented or not accepted by relevant evidence. **OUT OF SCOPE** = deliberately not modified/tested in this documentation-only phase. + +### Exact read-only source evidence + +- `deployment/docker/compose.backend.dev.yaml`: official Go ZITADEL image **`ghcr.io/zitadel/zitadel:v4.20.4`** (version tag, not pinned OCI digest) and **`postgres:17.10-alpine`**, Traefik `v3.7.7`; dev `ZITADEL_EXTERNALDOMAIN=localhost`, `ZITADEL_EXTERNALSECURE=false`, `ZITADEL_TLS_ENABLED=false`, direct `--masterkey` argument and developer bootstrap first admin, test PAT/temporary local volumes. `core/backend/zitadel/dev.py` is local-only. This developer Compose must never be promoted to live production unchanged. Go ZITADEL **source is not vendored** in `core/**`; it is an external official image. +- `deployment/production-contract/{compose.ci.yaml,routing-policy.json}` and `.gitea/workflows/p05-production-contract-dry-run.yml`: intentionally **NON-DEPLOYABLE** `synthetic.invalid` image refs, five zero replicas, private-only network, unresolved *symbolic* external placeholders, exact proposed issuer/callback/Host+Forwarded/h2c trust policy. Manual `config` only, no application service lifecycle. [Run #105](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/105) / job #221 **COMPLETED SUCCESS**, source `daaa8b259a519ae0290ba28936ef2279b3a9172c`, 48/48 malformed in-memory cases PASS, Gitea task cleanup PASS. **It does not prove a real reverse-proxy configuration, cert or deployed app**. +- `auth/ui/v2/apps/login/{Dockerfile,package.json,src/**}` and `auth/ui/v2/{package.json,pnpm-lock.yaml,pnpm-workspace.yaml}`: imported official Login V2 source **v4.20.4** (upstream revision documented `384bb9ec96b501ad39dc232ee2061a40fe180bbd`); original Dockerfile uses **`FROM node:24-alpine` as a mutable tag**, while disposable CI builder `tests/ci/login_image/build.sh` uses `node:22-bookworm` and pinned PNPM `10.30.3` via Corepack. The nested Login package's own `packageManager` declaration differs (PNPM 10.28.2); reconcile and document exact deliberate builder/runner/toolchain provenance in future approval. Original entrypoint tracked mode 100644 required **temporary copied-context 0755 fix**, not vendor file modification. [Run #99](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/99) confirmed a **real source-built temporary image + Chromium/PKCE/state/nonce/Auth.js session and cleanup** in disposable localhost CI. That image was removed: **no signed, pinned, registry-published deployment artifact accepted**. +- `users/ui/{package.json,package-lock.json,next.config.ts,src/auth.ts,src/lib/{env,identity}.ts,src/app/**}`: Account is separate Next.js/Auth.js 5 confidential OIDC relying party; `output:"standalone"`, `next@16.4.6`, `next-auth@5.0.0-beta.32`, checked-in **npm lockfile present**, source HTTPS-origin validation when `NODE_ENV=production`, `AUTH_SECRET` minimum length 32 characters, PKCE/state/nonce and provider subject/token-expiry fail-closed session. Protected page/API gate and portal-local logout are in source; **automatic access-token refresh, cross-app/global logout and portal-native factor management are NOT implemented**. `users/ui/src/lib/identity.ts` constructs an IdP self-service link, not administrative control. No tracked Account `Dockerfile`/production packaged OCI image/release workflow, no actual public cookie/Host trust or registered production callback acceptance. Some older docs say lockfile absent/build pending — **historical/stale** after P05-SEC/P05-CI; do NOT repeat that as current fact. Earlier accepted Gitea Account frozen npm build/audit and isolated Account real OIDC are historical CI, not a production image. +- `.gitea/workflows/p05-security-acceptance.yml`, `project/DEPENDENCY-SECURITY.md`: [Run #89](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/89) accepted pinned Login PNPM frozen install/build, upstream Vitest 1219/1219 and then-current zero Moderate/High/Critical production advisory results; earlier [Run #87](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/87) accepted Account npm frozen build and audit. **These are dated scans (Nov 22–23, 2026), not future release-time SCA/SBOM/signature evidence**. No signed multi-image provenance pipeline or production-release workflow appears under the six checked-in Gitea workflow YAMLs. +- `notes/P05-OIDC-07.md`, `docs/P05-OIDC-07.md`: `https://auth.vib.tools` **proposed** single external issuer/TLS443, private Login V2 `/ui/v2/login/**` port3000 and ZITADEL Go API/Console port8080 **h2c** with gRPC-Web; separate `https://account.vib.tools` and **exact** confidential callback `https://account.vib.tools/api/auth/callback/zitadel`. Edge must reject unknown Host, strip/replace untrusted Forwarded/X-Forwarded-*, avoid IPv4/IPv6 publicly published API/Login/PG ports, and verify actually issued Secure/HttpOnly/SameSite/host-only cookies and signed-out behavior. **No active production DNS/TLS/ingress read or change**. +- `notes/P05-OIDC-07.md` key and recovery design: **exact 32-byte** ZITADEL master-key managed separately from encrypted PostgreSQL backup, limited `IAM_LOGIN_CLIENT` PAT distinct from offline audited `IAM_OWNER` break-glass; Login session-cookie secret independent of Account `AUTH_SECRET` and confidential Web client secret; rotations, private DB, encrypted offsite/PITR/isolated restore and tested RPO/RTO. This is **only design**, no real vault/secrets, key escrow, backup restore or IAM recovery evidence. +- Existing `deployment/docker/compose.backend.dev.yaml` sets instance-wide `ZITADEL_DEFAULTINSTANCE_FEATURES_LOGINV2_REQUIRED=true` **in development**. Production activation without verified Admin Console and IAM_OWNER API emergency bypass can cause tenant-wide lockout. Imported Login UI contains factor/passkey screens but **no accepted WebAuthn enrollment, SMTP recovery, Console admin E2E, second SaaS client or global SSO logout**. + +### Production preflight matrix — do not interchange evidence levels + +| Release dimension | Repository / Gitea evidence | Status | Required acceptance before production | +| --- | --- | --- | --- | +| Official ZITADEL Go backend & PostgreSQL runtime | Dev Compose version-tag refs; backend disposable [Run #86](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/86) | **SOURCE VERIFIED + CI VERIFIED (dev only); LIVE NOT VERIFIED** | Approved version/digest, capacity/migration and nonpublic network, production persistence | +| Imported custom Login V2 | Upstream v4.20.4 imported, standalone build, browser [Run #99](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/99) PASS | **SOURCE VERIFIED + CI VERIFIED (disposable); release BLOCKED** | Reproducible OCI production image, pinned base, SBOM/signature/SCA, safe 0755 entrypoint and immutable digest release | +| Account Portal/Auth.js | Source + tracked npm lock; npm build/security Run #87; disposable browser Run #99 | **SOURCE VERIFIED + CI VERIFIED (dev); image BLOCKED** | Production OCI packaging, immutable artifact/SBOM, secure host/cookie callback live E2E | +| Synthetic issuer/routing/secret policy | [Run #105](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/105) 48/48 negative rejects, exact static contract | **CI VERIFIED (static only)** | Real edge configuration, public TLS, headers/h2c, actual safe secret mount behavior | +| Public `auth.vib.tools` / `account.vib.tools` | Design target only | **LIVE NOT VERIFIED / deployment BLOCKED** | DNS ownership/CAA/AAAA where appropriate, valid renewals, real HTTPS discovery/issuer equality, strict callbacks and redirects | +| Image provenance/dependency release | Historical CI frozen builds/audits; no signed registry releases | **Historical CI VERIFIED; production release BLOCKED** | Per-image source commit and base digest, up-to-date CVE gate, SBOM/signatures attestation verified at pull/deploy, rollback digest retained | +| Secrets & human/admin recovery | Dev .env/bootstrap and documented separation only | **SOURCE VERIFIED dev; LIVE NOT VERIFIED / BLOCKED** | Vaulted stable 32-byte master key/escrow, least-privileged independent service PAT and IAM_OWNER, rotation/revocation/privileged audit, first-admin policy | +| PostgreSQL encrypted backup, restore and key escrow | Dev volume and CI disposable cleanup/persistence; no production restore evidence | **BLOCKED / LIVE NOT VERIFIED** | Encrypted offsite backups, independently restored *same matching* key+DB, operator-defined RPO/RTO, PITR/rollback drill | +| Admin Console and Login V2 cutover | Go/Console + imported Login source, dev forced Login V2 | **SOURCE VERIFIED; LIVE NOT VERIFIED / BLOCKED** | Stage canary/per-app cutover and human Console login; emergency IAM_OWNER recovery tested before forcing global Login | +| MFA/passkeys/SMTP | Upstream routes and portal informational links | **SOURCE VERIFIED (UI routes only); LIVE NOT VERIFIED** | Policy + origin/RP-ID challenges, enroll/rotate/recover/lost-device, SMTP verification, no lockout | +| Multiple SaaS OIDC clients/SSO/logout | One Account relying party in disposable real OIDC | **CI VERIFIED single app; multi-app BLOCKED** | Two independent clients/apps with issuer/audience/redirect/tenant/role isolation, logout/session semantics and negative tests | +| Operations / monitoring / incident response | Only CI runner-owned cleanup, dev healthchecks and design | **SOURCE VERIFIED dev; LIVE NOT VERIFIED / BLOCKED** | HTTPS/cert expiry, OIDC/error/DB/backup/secret alerts, health gates, documented rollback/incident ownership, restore alarm drill | +| This P05-OIDC-09 actions | Docs and read-only review only | **OUT OF SCOPE for runtime changes** | No new CI, local builds, DNS, secret use or live production action | + +### Release priority, dependencies, operator STOP conditions + +1. **P0 supply chain first (offline/disposable):** prove reproducible tracked-source Login image and Account image in separate, minimal CI phases; independently verify Go/Postgres/Traefik digest provenance; evaluate current vulnerabilities; only then approve isolated signing and registry publishing (separate permission/scope). Registry artifact acceptance does **not** allow deployment. +2. **P0 identity and data custody:** secure master-key ownership/escrow, Login service vs IAM_OWNER separation, Account client/auth secrets and their rotation; then backup encrypted independent PG data with matching key, isolated restore, restore-failure rollback, RPO/RTO and one-time first-admin recovery. **Never migrate real state or rotate master key before restore readiness.** +3. **P0 private runtime/operations:** nonpublic DB/API/port binding, stable persistent volumes/migrations, health/metrics/alerts and rollbacks. Configure canary/private deployment only under fresh approval, no production traffic or instance-wide LoginV2 toggle. +4. **P0 public HTTPS trust boundary:** separately approved real DNS/cert automation + edge policy, exact HTTPS issuer/callback, h2c routing, Host/Forwarded spoof negative tests including IPv6, cookies/HSTS staging. **Stop** on issuer mismatch, incorrect redirect, missing TLS/renewal or exposed ports. +5. **P0 admin safe cutover:** before enabling LoginV2 for all apps, verify two independent privileged recovery paths (real Admin Console plus isolated IAM_OWNER API break-glass), protected PAT, canary/per-app rollback, recover from an intentionally isolated misroute; lockout is a STOP. +6. **P0 controlled real OIDC:** after gated real HTTPS infrastructure, verify real Login V2 + Account confidential Web client, PKCE/state/nonce, secure host-only cookies, authenticated API, negative redirect/Host/CSRF/session expiry, local vs federated logout contract, private logs and cleanup. Do not use real identities in CI. +7. **P1 separately:** real MFA/passkey/SMTP recovery, then second SaaS app/multi-tenant OIDC/SSO and session/logout, followed by HA/backup/incident drill and separate final release/change approval. **Monitoring and backup alerts must be established before opening public traffic**, even if deeper HA follows later. + +**Global STOP/rollback:** no production action without explicit separate approval; unverified matched masterkey/DB backup or admin break-glass, mutable/unsigned image, missing secure TLS issuer/Host trust, unregistered callback, uncontrolled exposed ports, failed signed digest/rollback verification, failed restore drill, insecure cookie/secret, unowned resources or user-impacting authentication regression = **fail closed**. Rollback must preserve DB, master key and existing credentials, pin previous tested image digest and proxy routing, avoid downgrading schema without proven reversible migration, no mass logout, and require audit log + explicit operator approval for any stateful recovery. No live rollback performed here. + +### Separately approvable narrow phase ladder (PROPOSED ONLY; not authorized) + +Each phase requires its own **new pre-source Scope Lock note**, evidence-first source diff, exact write whitelist, protected unrelated paths, security/rollback gate, one focused verification/one CI maximum where authorized, docs synchronization and final SHA. No silent broad scope creep. + +| Order | Proposed phase | Exact candidate write boundary | One independent acceptance / exclusions | +| --- | --- | --- | --- | +| 1 | **P05-OIDC-10 — CI-only imported Login OCI image provenance & reproducible build gate** | **NEW** `notes/P05-OIDC-10.md`, `tests/ci/login_image/provenance.py`, `tests/ci/login_image/{README.md,MINIFEST.md}`, **NEW** `.gitea/workflows/p05-login-provenance.yml`; narrowly existing `tests/ci/login_image/build.sh` only if separately justified by reproduced defect; relevant notes/project/docs, matching manifest/README | One disposable Gitea run: imported source SHA + pinned builder/base OCI digest evidence (no unpinned mutable deployment image), frozen PNPM/Next standalone/image, entrypoint 0755, safe SBOM/materials attestations and strict no secrets; cleanup. **No registry push, signing keys, release, Account/backend edit, production, tags** | +| 2 | **P05-OIDC-11 — Account Portal OCI image packaging/CI provenance** | NEW isolated `tests/ci/account_image/**`, new manual account-image workflow, **ONLY if required** `users/ui/Dockerfile` and necessary Account image build config (no Auth.js behavior edit), docs | `npm ci` frozen build using existing lock, secure standalone nonroot OCI, digest+SBOM+anonymous/synthetic auth-negative validation; no publish/deploy | +| 3 | **P05-OIDC-12 — Official backend DB/Traefik digest and compatibility/SBOM review** | CI-only new pin/security manifest and dedicated new manual workflow/helper (paths to be set in its own Scope Lock), docs; existing dev Compose read-only | Verify official ZITADEL Go/PG/Traefik version→immutable digests and licensing/CVE/upgrade/migration compatibility; no replacement of running images | +| 4 | **P05-OIDC-13 — Release attestation/signing and nonproduction registry publication** | New release-only workflow/helper + trust policy docs (exact paths/credentials determined at approval); no app source | Verify manifest list/SBOM/signature provenance and digest-pinned pull from private staging registry, rollback digest; **new registry-only authorization** required, no VPS deployment | +| 5 | **P05-OIDC-14 — Secure secret custody & IAM_OWNER break-glass contract** | New narrowly scoped security configuration/provisioning **only as separately approved** + docs; use disposable placeholders first | Vault/escrow, stable 32-byte key, least-privilege distinct Login PAT, Account client/session secrets, rotation and audited emergency recovery; no real secret creation until live approval | +| 6 | **P05-OIDC-15 — PostgreSQL encrypted recovery and isolated restore acceptance** | New dedicated backup/restore tooling and CI-only disposable recovery tests; existing dev and synthetic stacks read-only | Encrypted backup+matching key escrow and isolated restore/PITR/rollback failure drills, bounded RPO/RTO; no production restore | +| 7 | **P05-OIDC-16 — Private production runtime, observability and rollback foundation** | New separately approved production-only non-dev deployment material and monitoring scripts; **no dev Compose overwrite** | Stable private networks, restricted DB, digest-locked images, health/alerts, snapshot/rollback with dry-run; no public ingress or global LoginV2 flip | +| 8 | **P05-OIDC-17 — Public HTTPS issuer + trusted h2c ingress acceptance** | New production edge/DNS/TLS files only with explicit hosting/domain approval; secrets separate | Real issuer/cert/renewals and exact Host/Forwarded/callback/h2c/IPv4+IPv6 negative verification with zero public backend ports, rollback route | +| 9 | **P05-OIDC-18 — Admin Console/IAM_OWNER and Login V2 canary cutover** | Exact auth feature config/cutover & recovery tooling only under explicit production scope | Real human Console and separate break-glass recovery **before** staged LoginV2 enforcement, test rollback on nonprod first | +| 10 | **P05-OIDC-19 — Real HTTPS Account OIDC, cookies and protected API** | Exact public OIDC client registration/session runtime config+focused live acceptance workflow; separate approval for test users | Real browser PKCE/state/nonce, strict callback/Host/forwarded/cookie/expiry and local logout, no production secrets in CI | +| 11 | **P05-OIDC-20 — MFA/passkey/SMTP recovery** | Narrow factor/email/policy tests/config only | Verified WebAuthn RP origin, enrollment/recovery/lost device, SMTP sender, scoped account policies and no lockout | +| 12 | **P05-OIDC-21 — Two independent SaaS OIDC client SSO and logout** | Dedicated second-client integration/fixtures; no unrelated billing/entitlement changes | Multi-app issuer/audience/role/tenant isolation, session and federated logout semantics; real second app acceptance | +| 13 | **P05-OIDC-22 — Production go/no-go and controlled release** | Operations/runbook/release metadata only after separate explicit release approval | Every P0 gate evidence, fresh vulnerability/security/backup/cert/alerts, no P0 blockers; operator-signed release/rollback window | + +**Phase order may be revisited if preflight finds an objectively blocking dependency; no implied authorization for any phase.** Import and Account OCI image source are separate to avoid mixing app/service boundaries. Future scopes need exact file count and branch SHA before implementation. + +### First exact ready-to-copy approval — P05-OIDC-10 (NOT YET APPROVED) + +**Baseline:** use the final verified **P05-OIDC-09 documentation-only** main SHA upon closure. +**Purpose:** CI-only imported Login OCI artifact provenance, deterministic build inputs and safe cleanup; **no production release or registry publishing**. +**Scope-first** `notes/P05-OIDC-10.md`; exact source writes **NEW** `tests/ci/login_image/provenance.py`, existing `tests/ci/login_image/{README.md,MINIFEST.md}`, **NEW** `.gitea/workflows/p05-login-provenance.yml` and **only if separately demonstrated/allowed** `tests/ci/login_image/build.sh` (do not modify by default). Associated workflow README/MINIFEST, notes/project/docs/source-inventory, root README if necessary. `auth/**`, `users/**`, `core/**`, `deployment/**`, other tests/workflows, package locks/manifests, runner, VPS/DNS/SSL/secrets strictly read-only; untracked `AI_INSTRUCTIONS.md` untouched. No altering old Run #99 or Run #105 workflows. Focus on image source SHA/material provenance, reproducible lock/build, base tag→immutable digest validation, original Dockerfile/user/entrypoint executable gate, safe SBOM metadata, temporary artifacts only and `always()` exact runner-owned cleanup. One new manual Gitea run only if separately approved, exact positive/negative cases, no rerun on failure, docs commit and exact remote SHA. **No registry push, signing private keys, deployed images, real credentials, infrastructure, tag or release.** + +**P05-OIDC-09 terminal production status:** preflight mapping completed **documentation only**. Gitea Run #105 synthetic acceptance and Run #99 isolated real OIDC **remain accepted**, but **production GO/NO-GO = NO-GO/BLOCKED** pending P0 gates and separate approvals. No production/DNS/SSL access was attempted. +