docs(oidc): map synthetic validator functions and Run 101 acceptance boundary

This commit is contained in:
victorsteele428 committed 2026-11-23 12:41:08 +00:00
1 parent 78cab750c9
commit ce116a6b4c
5 files changed
+35

No files matched your search

+4
View File
@@ -51,3 +51,7 @@ See `docs/PHASES.md`, `docs/P02-EVIDENCE.md`, `docs/P03-SOURCE-IMPORT.md` and `d
- Public **issuer** `https://auth.vib.tools` (proposed only): one TLS-terminating trusted ingress; `/ui/v2/login/**` → imported Login V2 private 3000, all other ZITADEL API/discovery and `/ui/console/**` → official Go private 8080 via **h2c** for gRPC/gRPC-Web; static exact Host/forwarded-header allowlist, no direct host backend/DB ports. - Public **issuer** `https://auth.vib.tools` (proposed only): one TLS-terminating trusted ingress; `/ui/v2/login/**` → imported Login V2 private 3000, all other ZITADEL API/discovery and `/ui/console/**` → official Go private 8080 via **h2c** for gRPC/gRPC-Web; static exact Host/forwarded-header allowlist, no direct host backend/DB ports.
- Independent relying-party `https://account.vib.tools` (proposed only): separate HTTPS ingress to Auth.js Account, exact registered confidential Web-client callback `https://account.vib.tools/api/auth/callback/zitadel`. Keep user sessions/cookies host-scoped, protected APIs/no-store and issuer/client/subject validation. - Independent relying-party `https://account.vib.tools` (proposed only): separate HTTPS ingress to Auth.js Account, exact registered confidential Web-client callback `https://account.vib.tools/api/auth/callback/zitadel`. Keep user sessions/cookies host-scoped, protected APIs/no-store and issuer/client/subject validation.
- Security/operations boundaries: dedicated `IAM_LOGIN_CLIENT` service identity separate from break-glass `IAM_OWNER`; exactly 32-byte ZITADEL master key protected with separately encrypted Postgres backups/restores; safe Login V2 Console cutover/rollback; digest-locked image provenance and monitoring. Existing `deployment/docker/compose.backend.dev.yaml` remains localhost HTTP/dev only; no real production domains/DNS/certificates/secrets were read or changed. See `notes/P05-OIDC-07.md`, `docs/P05-OIDC-07.md`. - Security/operations boundaries: dedicated `IAM_LOGIN_CLIENT` service identity separate from break-glass `IAM_OWNER`; exactly 32-byte ZITADEL master key protected with separately encrypted Postgres backups/restores; safe Login V2 Console cutover/rollback; digest-locked image provenance and monitoring. Existing `deployment/docker/compose.backend.dev.yaml` remains localhost HTTP/dev only; no real production domains/DNS/certificates/secrets were read or changed. See `notes/P05-OIDC-07.md`, `docs/P05-OIDC-07.md`.
## P05-OIDC-08 — synthetic contract vs real production architecture
The new `deployment/production-contract/compose.ci.yaml` and `routing-policy.json` are **not deployable** or active ingress; they model the proposed HTTPS issuer `https://auth.vib.tools`, `https://account.vib.tools` separate Account origin, exact callback, ZITADEL h2c private API/Console, Login V2 private 3000, edge Host/Forwarded sanitization and secret references. All images are `synthetic.invalid`, replicas zero, private network and no ports. They are separate from untouched `deployment/docker/compose.backend.dev.yaml`, existing real Account/Auth.js, imported Login V2 source and production infrastructure. [Run #101](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/101) passed Compose structural parse but **FAILED** strict normalized Compose `RUNTIME_BEHAVIOR` validation; no negative fixtures ran, so the contract is **NOT security accepted**. Existing real custom Login CI [Run #99](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/99) remains accepted in its original development-only boundary. See `notes/P05-OIDC-08.md`.
+8
View File
@@ -184,3 +184,11 @@ Source SHA `7d6b6d0704b9e39bcb6e74257dadf0b64a19fc0f` changed only the `tests/ci
## P05-OIDC-07 — acceptance gate gap and next dry-run proposal ## P05-OIDC-07 — acceptance gate gap and next dry-run proposal
This phase dispatched **no new CI**. Earlier manual Run #99 [SUCCESS](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/99) on `7d6b6d0704b9e39bcb6e74257dadf0b64a19fc0f` verified authentic custom-source Login OIDC and both cleanup systems, not production network/security/operations. **No existing workflow** is accepted as a production TLS/issuer/secret/backup contract validator. Propose independently approved `P05-OIDC-08` with *new only* manual `.gitea/workflows/p05-production-contract-dry-run.yml`, synthetic `deployment/production-contract/{README.md,MINIFEST.md,compose.ci.yaml,routing-policy.json}` and `tests/ci/production_contract/{README.md,MINIFEST.md,validate.py}`: static schema/Compose config (no `up`), exact positive + negative allowlist and secret-reference checks, zero external services, one CI run and no registry/deploy. Existing workflows and source remain strictly read-only. See `notes/P05-OIDC-07.md`. This phase dispatched **no new CI**. Earlier manual Run #99 [SUCCESS](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/99) on `7d6b6d0704b9e39bcb6e74257dadf0b64a19fc0f` verified authentic custom-source Login OIDC and both cleanup systems, not production network/security/operations. **No existing workflow** is accepted as a production TLS/issuer/secret/backup contract validator. Propose independently approved `P05-OIDC-08` with *new only* manual `.gitea/workflows/p05-production-contract-dry-run.yml`, synthetic `deployment/production-contract/{README.md,MINIFEST.md,compose.ci.yaml,routing-policy.json}` and `tests/ci/production_contract/{README.md,MINIFEST.md,validate.py}`: static schema/Compose config (no `up`), exact positive + negative allowlist and secret-reference checks, zero external services, one CI run and no registry/deploy. Existing workflows and source remain strictly read-only. See `notes/P05-OIDC-07.md`.
## P05-OIDC-08 — synthetic-only production contract validation and blocked gate
New **manual** `.gitea/workflows/p05-production-contract-dry-run.yml` uses a disposable Node22 Alpine job, Git checkout, `docker compose -f deployment/production-contract/compose.ci.yaml config --quiet` and `--format json | python3 tests/ci/production_contract/validate.py --compose-json-stdin`; the `always()` step runs `--workflow-safety`. No `docker compose up`, Docker build/pull/run, real DNS/TLS inquiry or application auth occurs. Job toolchain/checkout may use the CI runner environment, but not production endpoints.
[Run #101](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/101) / Job #217, exact source `2ca1b4493bd47209d0c7eabf7453feaeb1f5174a`, **COMPLETED FAILURE**: Compose parsing PASS `ZITPLANE_P08_COMPOSE_STATIC_CONFIG_PASS`; normalized security validator **FAIL `ZITPLANE_P08_FAIL_CLOSED_RUNTIME_BEHAVIOR`**; manually dispatched/no-resource-actions configured verification PASS; **25 in-memory negative cases NOT EXECUTED**. Normalized field name/type not logged, so the specific cause remains UNKNOWN. CI job container/task volumes/network removed by Gitea runner; this is not inspection of production resources. Existing imported custom Login V2 E2E [Run #99](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/99) remains a separate accepted result.
Next independent **P05-OIDC-08-A01** should modify **only** `tests/ci/production_contract/validate.py` to classify the offending Compose-normalized service field without values/secrets and permit only independently proven inert defaults, while rejecting real commands/build/configs. Then one separately approved CI static run, no rerun in P05-OIDC-08.
+9
View File
@@ -211,3 +211,12 @@ Source-tested SHA `7d6b6d0704b9e39bcb6e74257dadf0b64a19fc0f`; documentation clos
- `users/ui/src/{auth.ts,lib/env.ts,lib/identity.ts,components/account-shell.tsx}`, `users/ui/next.config.ts`, `.env.example`: production HTTPS origin validator, Auth.js PKCE/state/nonce/session expiry, trusted Host toggle, protected profile, Console link and **portal-local** logout. No actual public ingress or global logout. Read-only. - `users/ui/src/{auth.ts,lib/env.ts,lib/identity.ts,components/account-shell.tsx}`, `users/ui/next.config.ts`, `.env.example`: production HTTPS origin validator, Auth.js PKCE/state/nonce/session expiry, trusted Host toggle, protected profile, Console link and **portal-local** logout. No actual public ingress or global logout. Read-only.
- `core/backend/zitadel/dev.py`: development `.env` generator/admin bootstrap and local container runner, not production key rotation/secrets/backup. - `core/backend/zitadel/dev.py`: development `.env` generator/admin bootstrap and local container runner, not production key rotation/secrets/backup.
- `tests/ci/oidc_e2e/**`, `tests/ci/login_image/**` and manual Gitea workflows: Run #99 **disposable HTTP localhost custom Login real OIDC** only, not public HTTPS/cert/production recovery. All paths strictly read-only in this phase. Full contract `notes/P05-OIDC-07.md`. - `tests/ci/oidc_e2e/**`, `tests/ci/login_image/**` and manual Gitea workflows: Run #99 **disposable HTTP localhost custom Login real OIDC** only, not public HTTPS/cert/production recovery. All paths strictly read-only in this phase. Full contract `notes/P05-OIDC-07.md`.
## P05-OIDC-08 — new static-only CI contract files (non-deployable)
- `deployment/production-contract/{README.md,MINIFEST.md,compose.ci.yaml,routing-policy.json}`: proposed `auth.vib.tools` canonical HTTPS issuer, separate `account.vib.tools` RP + exact Auth.js callback, Login V2/Console/API h2c routes/strict Host forwarded-header and symbolic secret refs. Five `synthetic.invalid` images, zero replicas, internal network, no published ports/build/bind volumes. **Not an actual production Compose or ingress implementation.**
- `tests/ci/production_contract/{README.md,MINIFEST.md,validate.py}`: stdlib JSON-based strict static policy/normalized Compose checker and **25 in-memory targeted negative fixture functions** plus workflow allowlist checker. No new files beyond required folder docs.
- `.gitea/workflows/p05-production-contract-dry-run.yml`: manually triggered; only Compose `config`, Python static validation, `always()` safety proof; no service creation.
- `notes/P05-OIDC-08.md`, `docs/P05-OIDC-08.md`: exact baseline/Scope Lock, Run #101 terminal failure and separately approved next RCA. No source files in `auth/**`, `users/**`, `core/**`, existing Compose, old workflows/tests/manifests/locks or runner changed.
Run #101 source `2ca1b4493bd47209d0c7eabf7453feaeb1f5174a`: Compose parse PASS, normalized `RUNTIME_BEHAVIOR` FAIL; 25 negative fixtures NOT EXECUTED. Preserve exact historical results, no post-CI source repatch.
+8
View File
@@ -165,3 +165,11 @@ Run #99 confirmed input `644 UID:GID 0:0`, copied output/image executable and ac
- `users/ui/src/lib/identity.ts::requireIdentity,zitadelSelfServiceUrl` enforces nonempty subject, produces policy-dependent Console self-service link; `users/ui/src/components/account-shell.tsx::portalLogout` calls local `signOut` only. - `users/ui/src/lib/identity.ts::requireIdentity,zitadelSelfServiceUrl` enforces nonempty subject, produces policy-dependent Console self-service link; `users/ui/src/components/account-shell.tsx::portalLogout` calls local `signOut` only.
- `auth/ui/v2/apps/login/src/lib/server/service-url.ts::getServiceConfig,constructUrl` relies on publicHost/forwarded headers, and `src/proxy.ts::proxy` performs upstream rewrites/CSP/CORS; security at public proxy/Host trust must be verified separately. `src/lib/server/custom-headers.ts::applyCustomHeaders` uses configured headers. No upstream change. - `auth/ui/v2/apps/login/src/lib/server/service-url.ts::getServiceConfig,constructUrl` relies on publicHost/forwarded headers, and `src/proxy.ts::proxy` performs upstream rewrites/CSP/CORS; security at public proxy/Host trust must be verified separately. `src/lib/server/custom-headers.ts::applyCustomHeaders` uses configured headers. No upstream change.
- `core/backend/zitadel/dev.py::create_dev_env,validate_env` generates **development** secrets only (master key 32 chars, login cookie >=32), not production KMS/escrow or rotation. No new functions or behavior in P05-OIDC-07; see `notes/P05-OIDC-07.md`. - `core/backend/zitadel/dev.py::create_dev_env,validate_env` generates **development** secrets only (master key 32 chars, login cookie >=32), not production KMS/escrow or rotation. No new functions or behavior in P05-OIDC-07; see `notes/P05-OIDC-07.md`.
## P05-OIDC-08 — stdlib static validator function contract
`tests/ci/production_contract/validate.py::validate_policy` validates fixed canonical HTTPS issuer/origin/callback, confidential code+PKCE/state/nonce, exact ordered Login/Console/API/Account routes (ZITADEL h2c), unknown Host reject and forwarded header strip-and-replace, required symbolic secret references.
`validate_compose` accepts normalized JSON from Compose `config --format json` and enforces exact synthetic images, five services, private-only network, zero replicas, no ports/volumes/sockets/privileged fields, referenced-only external placeholder secrets and no embedded environment secrets. **In Run #101 it failed with `RUNTIME_BEHAVIOR`** while checking the normalized service dict; offending field/type not logged and cannot yet be assigned to Compose default vs true runtime field.
`negative_cases` contains **25 targeted in-memory mutation checks** that require a specific error class. Run #101's positive failure occurred **before** this function; negative coverage is **NOT EXECUTED**. `workflow_safety` allows only two `docker compose ... config` commands, manual trigger, and proves no Docker lifecycle actions configured; **PASS** in Run #101. `main` prints fixed status codes; no input/credential dumps, DNS, runtime containers or external contacts. A01 may diagnose/reconcile Compose normalized inert keys only with separate approval.
+6
View File
@@ -109,3 +109,9 @@ CI only: official ZITADEL v4.20.4, official Login V2 v4.20.4, PostgreSQL 17.10/T
## P05-OIDC-07 — production readiness contracts (no infrastructure changes) ## P05-OIDC-07 — production readiness contracts (no infrastructure changes)
Current deployment material is only a localhost HTTP developer Compose plus a CI-only custom-image override; use neither as a production installer. Source-level Account `ZITADEL_ISSUER` and `AUTH_URL` require HTTPS when `NODE_ENV=production`, and `AUTH_TRUST_HOST` is only valid behind a proxy that sanitizes forwarded Host/Proto. Proposed public hosts `auth.vib.tools` and `account.vib.tools` are **not verified**. Need external trusted certificate, issuer=discovery, exact callback, ZITADEL h2c/HTTP2 Console, strict headers/cookies, private DB/backend ports, least-privileged Login service, separate break-glass IAM_OWNER, exactly 32-byte master key protected with corresponding encrypted DB restore, SMTP and incident/rollback tests. Image tags and successful ephemeral custom image in Run #99 are not signed/digest-locked production artifacts. No secret/key/TLS/DNS/backup/production values accessed or created. Details `notes/P05-OIDC-07.md`. Current deployment material is only a localhost HTTP developer Compose plus a CI-only custom-image override; use neither as a production installer. Source-level Account `ZITADEL_ISSUER` and `AUTH_URL` require HTTPS when `NODE_ENV=production`, and `AUTH_TRUST_HOST` is only valid behind a proxy that sanitizes forwarded Host/Proto. Proposed public hosts `auth.vib.tools` and `account.vib.tools` are **not verified**. Need external trusted certificate, issuer=discovery, exact callback, ZITADEL h2c/HTTP2 Console, strict headers/cookies, private DB/backend ports, least-privileged Login service, separate break-glass IAM_OWNER, exactly 32-byte master key protected with corresponding encrypted DB restore, SMTP and incident/rollback tests. Image tags and successful ephemeral custom image in Run #99 are not signed/digest-locked production artifacts. No secret/key/TLS/DNS/backup/production values accessed or created. Details `notes/P05-OIDC-07.md`.
## P05-OIDC-08 — static validator dependencies only; no production installer
The new manual CI workflow installs Git, Python 3 stdlib, Docker CLI/Compose and uses `docker compose config --quiet` and `--format json`, passing normalized JSON to `tests/ci/production_contract/validate.py`. There are **no new npm/pnpm packages, manifests, lockfiles, images to release, secrets, production DNS/TLS dependencies or Docker daemon lifecycle commands**. The five `synthetic.invalid` Compose services and named external CI placeholder secrets are *contract objects only*, not runnable production infrastructure. The validator reads only checked-in local files and stdin and contains 25 in-memory malformed cases.
[Run #101](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/101) source `2ca1b4493bd47209d0c7eabf7453feaeb1f5174a` proves Parse PASS and workflow safety PASS but normalized runtime-field guard **FAIL**, so no 25-negative acceptance. The runner job's tools may be installed through CI package sources, but this does not query proposed auth/account public endpoints. Future `P05-OIDC-08-A01` requires a separate one-file validator RCA and independent CI. Never attempt `docker compose up` with these fixtures.