docs(audit): publish P05-OIDC-07 production security contract and CI-only next scope

This commit is contained in:
victorsteele428 committed 2026-11-23 11:23:43 +00:00
1 parent d5561fa37c
commit 688b4bdf13
2 files changed
+133 -1

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
# P05-OIDC-07 — Production HTTPS & Recovery Contract (Design Only)
**Status:** Read-only forensic design COMPLETE. Previous [Gitea Run #99](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/99) job #214 **SUCCESS** on `7d6b6d0704b9e39bcb6e74257dadf0b64a19fc0f` proved source-built imported Login V2, real Chromium PKCE/state/nonce/Auth.js Account session/negative/logout and owned cleanup **in disposable HTTP localhost CI only**. **Production HTTPS/DNS/Console/MFA/SSO NOT VERIFIED.** No new CI was run for this document.
## Proposed two-domain architecture (not live/verified)
| Public entry | Proposed purpose | Required secure routing |
| --- | --- | --- |
| `https://auth.vib.tools` | **One canonical ZITADEL OIDC issuer**, discovery, API and Admin Console | HTTPS 443; valid certificate; internal ZITADEL h2c/HTTP2 8080; `/ui/v2/login/**` goes to imported Login V2 internal 3000; `/ui/console/**` to ZITADEL Go |
| `https://account.vib.tools` | Separate Account Portal/Auth.js relying party, **not another issuer** | HTTPS 443; private Account service; exact callback `https://account.vib.tools/api/auth/callback/zitadel`; never accept arbitrary HTTP/wildcard origins |
These hostnames are **design targets only**, not verified DNS or public services. The tracked `deployment/docker/compose.backend.dev.yaml` explicitly uses `localhost`, HTTP issuer, development bootstrap and local port 8080. **Never deploy that file as-is to public Coolify/VPS.**
## Required security and operations checks before any real deployment
- **TLS and proxy:** trusted HTTPS issuer and certificate renewal; secure modern TLS; edge rejects unknown Host; strips and replaces untrusted `Forwarded`/`X-Forwarded-*`; ZITADEL gRPC/gRPC-Web requires **h2c/HTTP2 upstream** behind TLS terminator; no public ZITADEL 8080, Login 3000 or PostgreSQL 5432 (including IPv6). Verify Login path and Console independently.
- **OIDC/cookies:** register exact client/callback and approved post-logout URIs, keep PKCE/state/nonce; only trust Auth.js `AUTH_TRUST_HOST` behind validated proxy; verify actual Secure+HttpOnly+SameSite and host-only scope on real HTTPS. Current portal logout is **local**, not global SSO. Control CORS/CSRF/server-action origins; stage HSTS/preload carefully.
- **Admin and Login cutover:** verify real Console login and privileged API recovery *before* instance-wide Login V2 enablement, keep separate securely vaulted break-glass `IAM_OWNER` credential, and test per-app staged cutover/rollback first.
- **Identity secrets:** secure manager/offline encrypted escrow for the ZITADEL **32-byte master key**, restricted separate PostgreSQL credentials, least-privilege `IAM_LOGIN_CLIENT` PAT or supported key (not IAM_OWNER), independent Login session cookie secret, Auth.js `AUTH_SECRET` and confidential client secret, TLS/ACME and SMTP credentials; document expiry, rotation and incident response. **Do not reuse dev .env, temporary PAT, test account, or local volumes.**
- **Data recovery:** encrypted offsite Postgres backups **with separately protected matching master key**, operator-defined RPO/RTO, isolated periodic restore drill and rollback plan; no destructive restore to production as a CI test.
- **Production images:** digest-pinned ZITADEL/Login/Account, current dependency security review, provenance/SBOM/signature, vulnerability scan, rollback and monitoring alerts. The successful Run #99 image was runner-local and removed, **not a deployable release**.
**Status matrix:** Disposable custom Login/PKCE/Auth.js = **VERIFIED**. HTTPS origin validation and protected Account APIs = **IMPLEMENTED**. Live domains/TLS, production secure cookies/redirect registration, Console/MFA/SSO, managed secrets/backups/rollback = **UNVERIFIED/BLOCKED**. Proposed routing and security requirements above = **PROPOSED**.
## Operator sequence before production
1. Accept a **separate CI-only production configuration dry-run** that validates required HTTPS origin, exact paths, private h2c/Host and secret-reference policy using dummy data, **without deploying or contacting hosts**.
2. Separately approve secure production image artifacts, secret custody and encrypted backup/recovery design and tests.
3. Only after documented authorization, prepare actual infrastructure and test real HTTPS/OIDC, Console recovery and strict redirects. MFA/passkeys and multiple SaaS login require their own acceptance gates.
Detailed source mapping, source-backed evidence, priority blockers and the next exact P05-OIDC-08 Scope Lock: [notes/P05-OIDC-07.md](../notes/P05-OIDC-07.md).
Official references: [ZITADEL reverse proxy](https://zitadel.com/docs/self-hosting/manage/reverseproxy/reverse_proxy), [Login V2 safe cutover](https://zitadel.com/docs/self-hosting/manage/adopt-login-v2), [production checklist](https://zitadel.com/docs/self-hosting/manage/productionchecklist), [Login client/session](https://zitadel.com/docs/self-hosting/manage/login-client), [Auth.js deployment](https://authjs.dev/getting-started/deployment).
+100 -1
View File
@@ -30,4 +30,103 @@ This scope note must be committed **before any other P05-OIDC-07 documentation m
- Prior `P05-OIDC-05` and `P05-OIDC-06-A01` notes document dev-only localhost HTTP/backend Compose, imported image actual disposable OIDC acceptance and outstanding production/TLS/secret/MFA/multi-app gates.
- This phase cannot show that real production DNS, certificates, auth/account subdomains, Coolify/VPS, SMTP, issuer tenants or secrets exist; do not make such claims. Do not read live production credentials or touch any connected hosting service in this scope.
**Disposition at creation:** FORENSIC AUDIT PENDING, production deployment and HTTPS real-domain acceptance NOT EXECUTED.
## Completed source & contract forensic audit — read-only evidence
**Audit date:** 2026-11-23. **Pre-other-docs Scope Lock commit:** `d5561fa37c6dd5acbda0cbbe74f357fbc490d08d`. **Accepted source-tested CI:** [Run #99](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/99) / Job #214 `completed/success`, `7d6b6d0704b9e39bcb6e74257dadf0b64a19fc0f`; all five steps success, disposable imported custom Login V2 real OIDC/negative/logout and both owned cleanup PASS. **This phase did not dispatch/rerun CI, test a host, or access external production infrastructure.** Repository baseline has 771 tracked files; the two new first-party docs (this note + operator guide) will increase this to 773.
### Evidence classification — no category substitution
| Capability / trust boundary | Status | Immutable evidence / missing gate |
| --- | --- | --- |
| Custom imported Login V2 source and temporary image runtime | **VERIFIED CI** | Run #99 actual image ID matched running Login container; Chromium password, PKCE/state/nonce/Auth.js callback, protected Account pages/API, negative/logout and both cleanup PASS |
| Original official prebuilt Login V2 path | **VERIFIED CI** | Distinct original prebuilt Run #96 successful; Run #98 was a historical custom image entrypoint failure subsequently resolved by A01; do not overwrite either history |
| ZITADEL/Traefik/Postgres dev network, h2c and isolated issuer | **IMPLEMENTED + VERIFIED in CI only** | `deployment/docker/compose.backend.dev.yaml`, `tests/ci/compose.portless.override.yaml`, Run #99, HTTP `localhost:8080`, four services healthy |
| Public DNS for `auth.vib.tools` and `account.vib.tools` | **PROPOSED / UNVERIFIED** | Target names only; **no live DNS query, network TLS inspection, Coolify/VPS/Cloudflare read or deployment** |
| Canonical production HTTPS issuer, valid certificates and proxy | **BLOCKED** | No production ingress/certificate/issuer config tracked; dev Compose `ZITADEL_EXTERNALDOMAIN=localhost`, `EXTERNALSECURE=false`, `TLS_ENABLED=false`, `Host:localhost`, published host loopback `8080:80` |
| Account Auth.js OIDC protocol/session | **IMPLEMENTED + VERIFIED in disposable CI** | `users/ui/src/{auth.ts,lib/env.ts,lib/identity.ts}`, `next.config.ts` and Run #99; PKCE/state/nonce, 1h JWT, subject+expiry rejection, HTTPS-origin rule in production |
| Actual production callback allowlist, cookies, trusted proxy | **UNVERIFIED / BLOCKED** | `AUTH_URL`, `ZITADEL_ISSUER` source validators exist; no public HTTPS callback registration, Secure/SameSite/Domain response or spoofed forwarded-Host negative acceptance |
| Console/admin human auth and Login V2 cutover/rollback | **UNVERIFIED / BLOCKED** | Dev Compose enables instance-wide Login V2; only Account login was browser-tested. No Console login, emergency access, per-app staged rollout, production rollback tested |
| Login/Account credentials and identity recovery | **IMPLEMENTED dev-only; production BLOCKED** | `core/backend/zitadel/dev.py` generates ignored local .env; dev first-admin, Login PAT/bootstrap volume, DB password. No protected production KMS/secret manager/rotation audit |
| MFA/passkey, recovery, global logout, multi-app SSO | **UNVERIFIED** | Imported upstream pages exist; no real factor enroll/recover/WebAuthn RP-domain/Console human, second OIDC client or federated logout CI |
| Production database durability, encrypted offsite backup/restore | **BLOCKED** | Dev named Postgres volume and disposable CI synthetic persistence prove no managed recovery. No production RPO/RTO/restore drill/master-key escrow verified |
| Production image release, signing/advisory refresh/observability | **BLOCKED** | Existing images are tags, imported custom CI image `zitplane-login-ci:99` was local ephemeral and CLEANED. No release provenance/SBOM/signature/registry/rollback/TLS monitoring accepted |
### Proposed production-domain and routing contract — DESIGN ONLY
**Canonical issuer:** `https://auth.vib.tools` (origin, no nonstandard port or path). Discovery `https://auth.vib.tools/.well-known/openid-configuration` must advertise the same immutable issuer and HTTPS endpoints; the real ZITADEL instance and every relying party must agree on it. This is not a live verified URL.
| Public route / audience | Proposed ingress | Private target / security contract |
| --- | --- | --- |
| `https://auth.vib.tools/ui/v2/login/**` | TLS 443, exactly one trusted public Host | Imported source-built Login service on private 3000, preserve basePath and official Login V2 callback flows |
| `https://auth.vib.tools/ui/console/**` | Same origin, not a second ID provider | Official ZITADEL Go API/Console on internal 8080 **h2c (HTTP/2)** with gRPC-Web; verify actual Console login before cutover |
| `https://auth.vib.tools/.well-known/**`, `/oauth/**`, `/oidc/**`, `/v2/**`, `/management/**`, other official API/console paths | One issuer, no split-brain public host | ZITADEL Go on private h2c; **default all paths except Login prefix to API**, not a blind copy of the dev-only `/api` strip alias |
| `https://account.vib.tools/**` | Independent TLS 443 vhost; not a second issuer | Private Account Next.js/standalone server, Auth.js callback handled on Account host |
| `https://account.vib.tools/api/auth/callback/zitadel` | **Exact registered OIDC Web client redirect** | Confidential ZITADEL Web client, code+PKCE S256/state/nonce, reject wildcard/HTTP/arbitrary subdomain/redirect and untrusted forwarded origins |
| `https://account.vib.tools/signin`, `/account/**`, `/api/account/me` | Account private app, authenticated page/API | Same-origin HttpOnly cookies, fail-closed subject and token expiry, authenticated API private/no-store; verify actual Secure/SameSite settings and cross-subdomain redirects |
| Unencrypted port 80 | Optional **redirect-only** HTTP→HTTPS, preferably no app/API response | No bearer tokens, Login or callbacks over HTTP; HSTS staged after all relevant HTTPS subdomains actually confirmed |
| TCP 8080/3000/5432 and container/admin/metrics ports | **Not publicly published** (including IPv6) | Private network, DB firewall ACL; health/metrics least-privilege internal; route by name to stable containers only |
**TLS/transport:** Terminate TLS at one fully controlled ingress with renewals/alerts, valid certificate chains, modern TLS minimum/ciphers and HTTPS-only redirect, or deliberately approved end-to-end TLS mode. The ZITADEL official deployment guide distinguishes `external` TLS mode (proxy TLS → internal plain **h2c**) from `enabled` end-to-end TLS; configure `ZITADEL_EXTERNALSECURE`/external domain/port and TLS-mode semantics consistently with the chosen ZITADEL v4 image, rather than reusing development `false`. Verify HTTP/2 to clients where required, h2c for ZITADEL gRPC, Console gRPC-Web, health/discovery/API. Do not infer that a generic HTTP/1.1 Cloudflare/Nginx/Traefik chain suffices. Reference: https://zitadel.com/docs/self-hosting/manage/reverseproxy/reverse_proxy .
**Header/host/redirect trust boundary:** At edge reject unknown SNI/Host, malformed/duplicate `Host`, untrusted `Forwarded`/`X-Forwarded-Host`/`X-Forwarded-Proto`/`X-Forwarded-For`; overwrite these from **edge-verified** authority, do not append user-supplied values. Restrict proxy trust to known ingress hops. Set canonical HTTPS Host and scheme consistently for Login V2 and ZITADEL. Account `AUTH_TRUST_HOST=true` **only once ingress strips/overwrites upstream-spoofable headers**, since Auth.js then trusts the forwarded origin. In `auth/ui/v2/apps/login/src/lib/server/service-url.ts`, `constructUrl` uses publicHost and request protocol; imported `src/proxy.ts` conditionally rewrites `/.well-known/`, `/oauth/`, `/oidc/`, `/idps/callback/`, `/saml/`, `/assets/` and emits wildcard `Access-Control-Allow-Origin: *` on those proxy responses. This is **SOURCE PRESENT**, not a proven vulnerability; assess CORS/preflight and credentialed responses independently, avoid exposing a broad API proxy route or weakening CORS during ingress design. Dev `CUSTOM_REQUEST_HEADERS=Host:localhost,X-Forwarded-Proto:http` is **not valid production host policy**.
**CSP/HSTS/cookie boundary:** Imported Login `next.config.mjs` declares HSTS `max-age=63072000; includeSubDomains; preload`; do not opt into preload or broad subdomain enforcement until *all relevant subdomains* are confirmed HTTPS and renewal/recovery procedures exist. It also contains a server-action origin allowlist configurable through `SERVER_ACTION_ALLOWED_ORIGINS`; require exact known origins and test unexpected Origin and CSRF requests, no `*`. Account `users/ui/next.config.ts` sets `nosniff`, framing, Referrer/Permissions policies but not full production CSP/HSTS; the final edge policy must not conflict with Login's dynamic CSP and actual OAuth/Console assets. Prove response cookies (HttpOnly, Secure, bounded SameSite, Path and host-only scope); do not speculate that arbitrary cross-subdomain sharing is required. Use different secrets for different session issuers. Account `AUTH_SECRET` >=32 characters, stable across replicas; dedicated Login `ZITADEL_SESSION_COOKIE_SECRET` >=32 with supported phased rotation (new first, old temporarily accepted) and separate API credential. No leak of auth code, token, secret, cookie or redirect query to public logs.
**OIDC client contract:** One specific confidential Account client ID/secret bound to actual HTTPS issuer; register exact `https://account.vib.tools/api/auth/callback/zitadel` and only validated app-appropriate post-logout/redirect URI(s). No wildcard, HTTP, generic dynamic redirects or application cross-tenant audience mixing. Validate `iss`, `aud`, `sub`, PKCE, state, nonce and callback under true TLS; preserve existing Auth.js fail-closed expiration and Account API/no-store. Portal `account-shell.tsx::portalLogout` is **local signOut only**, not ZITADEL logout or global multi-app session revocation. Token refresh/server revocation and federated logout require a separate approved security implementation, not ingress rewrites.
### Login V2, Admin Console, MFA and cutover safety
The current dev Compose uses instance-wide `ZITADEL_DEFAULTINSTANCE_FEATURES_LOGINV2_REQUIRED=true`, which applies to **all** applications including the Console. A production cutover to imported Login UI must first verify private container/issuer routing, public `/ui/v2/login` health, API login-client authentication and an explicit **interactive Console sign-in** with least-privileged admin; preserve alternate break-glass IAM_OWNER machine account+PAT stored securely **outside** normal Login containers. The ZITADEL guide recommends **per-application gradual enablement** for existing installations and explains that instance-wide enablement overrides app settings. Rollback must be pretested without destroying DB/session/keys, with feature-state and image reversions preserving the canonical issuer and non-compromised secrets. IdP/SAML callbacks, trusted domains, application login base paths and organization policy require independent acceptance. Official: https://zitadel.com/docs/self-hosting/manage/adopt-login-v2 .
MFA/OTP/passkey UI routes are present in imported source, **NOT authenticated-factor enrollment/recovery accepted**. Passkeys/WebAuthn RP ID and registered origin depend on final domain; test enrollment, challenge replay/rejection, factor policy, lost-device recovery and Console break-glass in isolated HTTPS context under separate scope. Account `/account/security` currently supplies informative links only; `zitadelSelfServiceUrl()` uses `/ui/console/users/me` and does not prove role/policy access. Multi-SaaS SSO must have another independently registered client and enforce issuer+subject+audience/tenant/authorization in each app before acceptance.
### Production secret/bootstrap/backup/operations contract (proposed)
| Secret or privileged surface | Owner and minimum invariant | Rotation / backup / failure gate |
| --- | --- | --- |
| **ZITADEL master key** | Exactly **32 bytes** per ZITADEL specification, cryptographic identity independent of deployment; secret manager/HSM/offline encrypted escrow, tightly restricted access | Restore with same key+matching database backup; **never blindly regenerate or rotate**—would make encrypted data unrecoverable; prove documented key ceremony before any change |
| PostgreSQL application/admin credentials | Separate restricted DB accounts; private socket/network and TLS between hosts, not developer `sslmode=disable` used across insecure links | DB credential rollover tested; separate migration/init ownership; recovery operator can restore without exposing plaintext backup |
| Login V2 API service identity | Dedicated `IAM_LOGIN_CLIENT` service account (PAT via protected read-only file or supported signed system-user key), **not** `IAM_OWNER` | Protected issuance, scope and expiry, rotation/revocation+session impact; never grant login service emergency owner access |
| Break-glass identity | Separately protected `IAM_OWNER` machine account, out-of-band escrow+audit, limited emergency access | Test emergency API recovery of misconfigured instance-wide Login V2 without interactive Console; rotate after use; do not put PAT in Login env or CI logs |
| Login V2 session signing | Independent `ZITADEL_SESSION_COOKIE_SECRET`, >=32 characters, same across replicas | Document safe old/new-list phased rotation and session expiration; keep distinct from service credential |
| Account relying-party secrets | `ZITADEL_CLIENT_SECRET`, `AUTH_SECRET` >=32 chars, one confidential Web client; `AUTH_TRUST_HOST` only trusted sanitized proxy | Versioned secret injection, controlled overlap/rollout for user sessions, least-privilege client rotation and revoked stale credentials |
| TLS/ACME/DNS/SMTP credentials | Edge/proxy and mail service only; not injected into Account/Chromium/CI tests | Restricted filesystem/KMS, expiry monitoring, emergency certificate renewal, validated SMTP sender/recovery links; no production email acceptance in current repo |
**Provisioning:** A brand-new production instance must use a secure first-admin activation flow (verified email, required credential reset, least privilege) and approved bootstrap identity policies; never reuse `zitadel-admin@zitadel.localhost`, auto-verified local test email, `2028-01-01` dev Login PAT expiry, `user: "0"` defaults or ignored dev `.env` on production. Review root-running ZITADEL/Login containers and the Traefik Docker socket bind `/var/run/docker.sock:ro`: a read-only filesystem mount **does not make the Docker Engine API read-only**; prefer isolated Docker socket proxy with restricted endpoints or static/file provider and non-root service containers where supported. Nothing has been changed or validated on production.
**Data contract:** Pin PostgreSQL major/minor and upgrade policy; durable monitored storage; encrypted authenticated offsite backups, least-privilege restore access, tested PITR/consistent snapshots where applicable, separate key escrow, explicit operator-chosen RPO/RTO and retention, routine **isolated restore drills** that verify ZITADEL startup, issuer, keys, login and audit continuity. Never delete existing production DB or restore over a live instance in an unattended CI check. Backups lacking the matching master key, or key custody without DB, are not adequate recovery proof. Keep infrastructure config/secret identities and migrations versioned and access controlled; rehearse rollback including DB schema compatibility before rollout.
**Operations/release contract:** immutable image digests for Go ZITADEL, imported source-built Login and Account; secure build provenance, current dependency/advisory scan (Run #89's zero Moderate+ result is historical), SBOM and signed artifacts verified at deploy, no latest/mutable-only tags or ephemeral CI image mistaken for release. Current original imported Dockerfile uses `FROM node:24-alpine` tag and `docker build --pull` in the accepted test; Run #99 logged a resolved base digest **at that time** but did not pin/ship a production artifact. Store config changes as reviewed, roll out incrementally with automatic rollback gates, health for all paths, encrypted backup before migration, process isolation, SLO/alerts for upstream readiness, TLS certificate age, database disk/replication, API/login errors, abuse/rate limits, secret expiry and login/Console failure; protect log contents and audit admin/service-token actions. Include IPv4/IPv6 firewall and WAF/rate limits without breaking OAuth redirect or legitimate MFA.
### Blocker priority and decision gates
| Priority | Blocker / proposal | Minimum independent acceptance before live rollout |
| --- | --- | --- |
| **P0-1** | Production canonical HTTPS issuer, DNS/cert, TLS/proxy h2c/Host/callback | Fail-closed config validation, real HTTPS discovery issuer equality, exact redirect/CORS/forwarded-header negative tests, HTTP/2 Console/gRPC-Web; no public backend/DB ports |
| **P0-2** | Production key/DB/identity recovery and break-glass | Secret-store and 32-byte master-key escrow, protected Login API identity and emergency IAM_OWNER, encrypted backup+isolated restore exercise/rollback documented |
| **P0-3** | Immutable release artifacts and safe deployment | Source→image provenance/digest, current SCA/SBOM/signature, secretless dry-run, controlled change management; no runtime dev image |
| **P1-1** | Account HTTPS cookies/session and authorized callbacks | Real Secure/HttpOnly/SameSite/Host-only cookie, Auth.js callback under TLS, policy-negative redirect/CSRF and expiry, refresh/federated logout separately scoped |
| **P1-2** | Admin Console and Login V2 cutover | Interactive Console login and verified break-glass rollback with isolated database/tenant, no instance-wide feature switch before proof |
| **P1-3** | Factor/passkey/SMTP and second SaaS SSO | Verified WebAuthn origin/RP ID/enroll/recover; SMTP deliverability; at least 2 independent OIDC app clients and tenant isolation |
| **P2** | HA/monitoring/scaling/response | Operator-set RPO/RTO, metrics, HTTPS certificate and backup alerts, load/rollback and incident drill |
**Production verdict:** **BLOCKED / NOT VERIFIED.** This is a repository evidence finding, **not evidence that a particular external DNS/VPS/Coolify deployment exists or does not exist**. The only new result in this phase is a documentation security contract (not a build, test, CI or rollout). External official documentation reviewed for design assumptions only: https://zitadel.com/docs/self-hosting/manage/productionchecklist , https://zitadel.com/docs/self-hosting/manage/reverseproxy/reverse_proxy , https://zitadel.com/docs/self-hosting/manage/adopt-login-v2 , https://zitadel.com/docs/self-hosting/manage/login-client , https://zitadel.com/docs/concepts/architecture/secrets , https://authjs.dev/getting-started/deployment .
## Proposed separately approved P05-OIDC-08 — CI-Only Production Configuration Contract Dry-Run
**Purpose:** Encode the above design as **synthetic / non-deployable CI-only configuration contracts**, enforce fail-closed static validation, and prove that representative malformed TLS/issuer/routes/host/headers/secret references/public port configurations are rejected **without** talking to public DNS, production hosts or user services. This is **NOT** production deployment or actual external HTTPS acceptance.
**Exact candidate SOURCE WRITE (only if newly approved):**
1. `notes/P05-OIDC-08.md` **first**, with Scope Lock and approved baseline.
2. New `deployment/production-contract/{README.md,MINIFEST.md,compose.ci.yaml,routing-policy.json}`: CI-only structurally realistic Compose topology plus declarative strict edge routes/issuer/secret requirements; clearly mark NOT FOR DEPLOYMENT. No real secret values, live domains queried or public ports; use static proposed FQDN labels and synthetic secret references; no automatic external DNS/TLS.
3. New `tests/ci/production_contract/{README.md,MINIFEST.md,validate.py}`: stdlib-only structural checks, synthetic positive and deliberately malformed negative fixtures generated in-memory; verify no published backend/DB ports, approved exact issuer/callback/Login path, ZITADEL h2c route, Host/forwarded sanitization contract, required env/secrets referenced-not-embedded, and fail on wildcard/HTTP/unknown hosts and privileged Docker socket.
4. New `.gitea/workflows/p05-production-contract-dry-run.yml`: **manual-only**, one disposable runner job, read-only checkout, `docker compose config --quiet` / JSON structural validation (NO `up`, build, pull, login, deploy, DNS lookup), then positive+negative synthetic static tests, no real credentials; no registry upload. Approve dispatch **exactly once** after focused diff/security audit.
5. Documentation only in `notes/**`, relevant `project/**`, `docs/**`, required associated `deployment/README.md`, `.gitea/workflows/{README.md,MINIFEST.md}`, `tests/ci/{README.md,MINIFEST.md}`, project/source inventory, root README if relevant. No other paths.
**STRICT READ-ONLY candidate:** Existing `deployment/docker/**` (both prior Compose files), `auth/**`, `users/**`, `core/**`, preexisting `tests/**` and `.gitea/workflows/**` outside the exact new files/associated documentation, all manifests/locks, runner settings, DNS/Coolify/VPS/live TLS, production secret managers, credentials and unrelated paths. Preserve untracked `AI_INSTRUCTIONS.md`.
**Gate:** One static/permission/security patch audit, source Git commit/push, **one separately approved manual CI dispatch**; log exact PASS/FAIL/NOT EXECUTED including reject-negative fixtures, cleanup verification (no created containers/resources), source SHA, documentation closure and remote HEAD. **No production account/bootstrap, secret creation, actual TLS, public DNS, image build, Docker containers, registry push, local tests, human data, deployment, tag or release.** Failure -> stop, report and request a new narrow phase; no scope creep/rerun.
**Future phases after this dry-run, separately approved:** production image provenance/release, secure secrets/backup/restore, external HTTPS ingress and genuine real-domain acceptance, Console/MFA/multi-app SSO. No deployment authorization is implied by P05-OIDC-08.