From 3fc49916cac1301dbbf9a0aecb89f0a558279b65 Mon Sep 17 00:00:00 2001 From: Md Nurnobi Date: Mon, 23 Nov 2026 12:31:07 +0000 Subject: [PATCH] docs(oidc): lock P05-OIDC-08 CI-only production security contract scope before edits --- notes/P05-OIDC-08.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 notes/P05-OIDC-08.md diff --git a/notes/P05-OIDC-08.md b/notes/P05-OIDC-08.md new file mode 100644 index 0000000..99c2844 --- /dev/null +++ b/notes/P05-OIDC-08.md @@ -0,0 +1,38 @@ +# 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):** +1. `.gitea/workflows/p05-production-contract-dry-run.yml` +2. `deployment/production-contract/README.md` +3. `deployment/production-contract/MINIFEST.md` (literal filename; not `MANIFEST.md`) +4. `deployment/production-contract/compose.ci.yaml` +5. `deployment/production-contract/routing-policy.json` +6. `tests/ci/production_contract/README.md` +7. `tests/ci/production_contract/MINIFEST.md` +8. `tests/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, exclusively `internal: true` synthetic 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 by `docker 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) and `https://account.vib.tools` (separate relying party), exact `https://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 json` on 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. + +**Initial status:** source NOT IMPLEMENTED, CI NOT DISPATCHED, external infrastructure NOT ACCESSED.