11 KiB
P05-OIDC-08 — CI-Only Production Configuration Contract Dry-Run
Date: 2026-11-23 (Asia/Dhaka)
User-approved and verified baseline: 4c4bb8155fb6c3c57f935d0c98af6a40325c60be
Previously accepted real OIDC: Gitea Run #99 / Job #214, completed/success, tested SHA 7d6b6d0704b9e39bcb6e74257dadf0b64a19fc0f (development-origin disposable HTTP localhost only).
Parent design and mandatory scope: notes/P05-OIDC-07.md — explicit non-deployable synthetic production security contract, not production infrastructure.
Baseline tree: 773 Git-tracked files; AI_INSTRUCTIONS.md is untracked and MUST remain untouched.
EXACT PRE-SOURCE-CHANGE SCOPE LOCK
Write this note and commit it before any source modification.
SOURCE WRITE — ONLY NEW FILES (no existing app/source/config edits):
.gitea/workflows/p05-production-contract-dry-run.ymldeployment/production-contract/README.mddeployment/production-contract/MINIFEST.md(literal filename; notMANIFEST.md)deployment/production-contract/compose.ci.yamldeployment/production-contract/routing-policy.jsontests/ci/production_contract/README.mdtests/ci/production_contract/MINIFEST.mdtests/ci/production_contract/validate.py
DOCUMENTATION WRITE ONLY: notes/**, relevant project/**, relevant docs/**, necessary associated deployment/README.md, .gitea/workflows/{README.md,MINIFEST.md}, tests/ci/{README.md,MINIFEST.md} and root README.md if justified. Do not create any other new folders/files.
STRICT READ-ONLY: auth/** (including imported upstream Login), users/**/Auth.js, core/**, existing deployment/docker/**, existing tests/** outside approved new folder/README/MINIFEST, all existing Gitea workflows outside the new one, package manifests/lockfiles, runner settings, all DNS/VPS/Coolify/Cloudflare/SSL/production secrets/production services, unrelated paths and untracked AI_INSTRUCTIONS.md.
PROHIBITED: Docker up, run, build, pull, image publishing, external DNS/HTTP lookups, secret generation, real user/identity/authentication, local application builds/tests, production deploy, tags/releases, changing real registry, touching real Docker resources/volumes. CI-only docker compose config --quiet and docker compose config --format json, stdlib Python static validation, read-only Git checkout and setup of Git/Python/Compose CLI are the sole execution target.
Locked proposed implementation
- Build a clearly non-deployable five-service Compose model with image references under reserved
.invalid, replicas set to 0, exclusivelyinternal: truesynthetic network, no published ports or Docker socket, no real mounts, build/runtime actions or secret material; declared external synthetic secret names are only references used bydocker compose config, not created/read by CI. Compose shape is a structural contract only, not an upstream production stack template and not valid runtime ZITADEL config. - Strict JSON routing policy for proposed, not live
https://auth.vib.tools(only issuer and Login V2 + API/Console host) andhttps://account.vib.tools(separate relying party), exacthttps://account.vib.tools/api/auth/callback/zitadel, non-wildcard redirects, exact Login prefix, API/Console h2c, strict Host + forwarded-header strip/replacement rule, explicit TLS requirement, no published backend/DB ports, only external secret references. - Stdlib Python validator accepts canonical output from
docker compose ... config --format jsonon stdin, parses companion JSON policy, checks full exact shape/allowlists with no unknown security keys, and runs in-memory positive and intentionally mutated negative fixtures for HTTP issuer, wrong issuer, callback/redirect wildcard, wrong Login/API paths, wrong h2c, untrusted Forwarded/Host, public container ports, missing secret references, embedded plaintext secrets, privileged/socket and deployability. Fail-closed test must reject every mutation and print safe stage markers (never secret values). - New manual-only Gitea workflow: disposable runner, Git checkout,
docker compose config --quiet, config JSON to validator, no daemon lifecycle calls;always()static no-resource-action verification, no claim of inspecting live daemon resources or production cleanup. - One focused source/security/diff audit, source commit/push to
main, dispatch exactly ONE approved manual disposable run. On any failure stop/no rerun or unapproved scope expansion. Record exact PASS/FAIL/NOT EXECUTED; synchronize documentation and manifests/inventory, documentation-only commit/push and verify final Gitea SHA. - Live DNS/TLS, actual certificates, Proxy/Console/MFA, production secrets, encrypted backup/restore, release images, SSO and real-world security acceptance remain UNVERIFIED, regardless of static CI outcome.
Terminal one-run CI acceptance and RCA boundary
Source preparation: Scope Lock note first committed at 3fc49916cac1301dbbf9a0aecb89f0a558279b65. Approved eight new source/workflow/folder docs files committed at tested source SHA 2ca1b4493bd47209d0c7eabf7453feaeb1f5174a with no changes to existing Auth.js/Go/Compose, existing workflows, packages or tests. Focused pre-run scope/security diff: 9 changed paths from original baseline (this note plus eight new files), 0 out of scope. Manual workflow active; source tree at tested SHA contained 782 tracked blobs.
One and only manual CI dispatch: Gitea Run #101, Job #217, on immutable tested source 2ca1b4493bd47209d0c7eabf7453feaeb1f5174a. Gitea completed / failure, 2026-11-23T12:37:13Z–12:37:30Z. Steps #0 CLI/Python install SUCCESS, #1 checkout SUCCESS, #2 static Compose/policy validation FAILURE, #3 always() manual-only/no-resource-action workflow safety check SUCCESS. No rerun, additional CI dispatch, or post-dispatch source patch.
| Gate | Terminal outcome / exact evidence |
|---|---|
| Manual-only workflow active and exact tested source checkout | PASS; Gitea job #217 |
| Static Compose schema normalization with no app startup | PASS ZITPLANE_P08_COMPOSE_STATIC_CONFIG_PASS (docker compose -f deployment/production-contract/compose.ci.yaml config --quiet) |
| Static workflow Docker command allowlist / manual-only | PASS ZITPLANE_P08_MANUAL_ONLY_NO_RESOURCE_ACTIONS_CONFIGURED_PASS (both normal validator and always step) |
| Positive strict normalized Compose + policy security contract | FAIL ZITPLANE_P08_FAIL_CLOSED_RUNTIME_BEHAVIOR |
| Exact normalized field responsible | UNKNOWN; validator emits safe error class only, not offending key/value; current CI log did not include normalized JSON or inspected offending key |
| Canonical issuer/callback, h2c routes, forwarded/header policy positive PASS markers | NOT EXECUTED; validator exits before these success markers |
| 25 in-memory invalid synthetic fixtures (HTTP, wildcard, wrong Host/callback, ports, secret references etc.) | NOT EXECUTED; positive validation failed first |
| Actual production DNS, TLS/certificates, real secrets, images, ZITADEL, Account login, MFA/SSO, backups | NOT EXECUTED / out of scope |
| Compose up, build, pull, login, runtime image registry/deployment | NOT EXECUTED (workflow commands were only Compose config; job container itself provisioned by Gitea runtime) |
| Job container/runner temporary environment cleanup | PASS in job terminal log: Gitea removed its task container, two task volumes and job network. Not a production/service-volume inspection. |
| Overall P05-OIDC-08 source/CI acceptance | BLOCKED / FAILURE. Source implemented and static Compose parses; full policy-positive + negative acceptance NOT VERIFIED |
Forensic interpretation and safety guardrail
The validator fails at its validate_compose() RUNTIME_BEHAVIOR restriction. The relevant source guard rejects build, command, entrypoint or configs keys in the normalized service dictionary, regardless of value. Docker Compose output may include normalized/default-valued fields; which field actually triggered rejection is not shown and has not been independently measured. Do not assert an exact root cause such as default command: null, and do not remove the runtime safety gate wholesale. No test evidence of a deployed/runtime security failure exists.
This is a CI contract-validator acceptance blocker, not a new imported Login V2/PKCE/Auth.js regression. Previously accepted custom Login Run #99 and original prebuilt Run #96 remain accepted in disposable CI. The P05-OIDC-07 production readiness BLOCKED verdict remains unchanged. The design uses .invalid image refs, 0 replicas, private networks and symbolic secret refs, but the complete normalized contract has not passed its security validator.
Proposed next exact Scope Lock — P05-OIDC-08-A01 (separate approval required)
Title: Normalized Compose Runtime-Field RCA & Synthetic Contract Acceptance.
- Pre-change note: new
notes/P05-OIDC-08-A01.mdcommitted before source modifications. - SOURCE WRITE EXACT:
tests/ci/production_contract/validate.pyonly. No change todeployment/production-contract/compose.ci.yaml,routing-policy.jsonor the existing manual workflow unless a separate newly approved Scope Lock expressly allows it. - DOCS WRITE:
notes/**, relevantproject/**,docs/**, associated README/MINIFEST if required. - STRICT READ-ONLY:
auth/**,users/**,core/**, bothdeployment/docker/**and newdeployment/production-contract/**, all existing.gitea/workflows/**, alltests/**except the one validator file and associated documentation, package manifests/locks, runner settings, DNS/VPS/Coolify/SSL, production secrets/infrastructure and unrelated files. Preserve untrackedAI_INSTRUCTIONS.md. - Evidence-first fix: in CI-only validator derive exact offending normalized service field name and safe type/null/empty classification, without printing values, full JSON, env/secrets or endpoint paths. Allow only a demonstrably inert Compose-added default e.g. null/empty command/entrypoint if evidence supports that finding, while retaining fail-closed rejection of actual executable overrides, image builds, configs, privileged mounts, public ports, nonzero replicas, real image tags and unsafe user input. If actual dangerous behavior is present, FAIL and stop; no broad bypass.
- Negative fixtures: add focused negative assertions for actual nonempty
command/entrypoint/build/configsand preserve the original 25 negatives, exact error classifications. - Verification: one focused scope/security audit, commit and push tested source, exactly one newly approved manual Gitea CI dispatch, static
docker compose config+ stdlib positive and deliberate negative checks + workflow-safety always step, no service containers, DNS query or real secrets. Record PASS/FAIL/NOT EXECUTED and final docs SHA; no repeated runs. - Subsequent production steps (secure release images, HTTPS, secret custody, backups/restore, MFA/Console, SSO) remain separately approved and must not be folded into A01.
P05-OIDC-08 status: Source skeleton implemented; static YAML/Compose config PASS; normalized contract validation FAILED, 25 negative cases NOT EXECUTED; workflow safety PASS. One-run limit exhausted. No deployed application or external production verified. Documentation-only closure SHA is not new CI-tested source.