From b235a39078a80464aaf01ee9fa1aca1f1f3e5c15 Mon Sep 17 00:00:00 2001 From: Md Nurnobi Date: Mon, 23 Nov 2026 12:54:30 +0000 Subject: [PATCH] docs(oidc): lock A01 normalized Compose RCA scope before validator source edit --- notes/P05-OIDC-08-A01.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 notes/P05-OIDC-08-A01.md diff --git a/notes/P05-OIDC-08-A01.md b/notes/P05-OIDC-08-A01.md new file mode 100644 index 0000000..88e7c59 --- /dev/null +++ b/notes/P05-OIDC-08-A01.md @@ -0,0 +1,36 @@ +# P05-OIDC-08-A01 — Normalized Compose Runtime-Field RCA & Synthetic Contract Acceptance + +**Date:** 2026-11-23 (Asia/Dhaka) +**Approved baseline:** `f3528841f444d1bc119bc067db2e044269141555`; Gitea `main` matched before changes. +**Prior tested source:** `2ca1b4493bd47209d0c7eabf7453feaeb1f5174a` +**Prior CI:** [Run #101](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/101), Job #217 `completed/failure`; `docker compose config --quiet` PASS, strict normalized Compose service validator `ZITPLANE_P08_FAIL_CLOSED_RUNTIME_BEHAVIOR` FAIL, all original 25 negative fixtures NOT EXECUTED, manual workflow/no-resource-action check PASS and runner job cleanup observed. Previously accepted imported custom Login V2 [Run #99](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/99) remains SUCCESS. + +## PRE-SOURCE-CHANGE Scope Lock — USER APPROVED + +**MUST commit this note before modifying code.** + +**SOURCE WRITE EXACT:** +- `tests/ci/production_contract/validate.py` **ONLY**. + +**DOCUMENTATION WRITE:** +- `notes/**` +- relevant `project/**` +- relevant `docs/**` +- associated README/MINIFEST entries only if necessary. + +**STRICT READ-ONLY:** `auth/**`, `users/**`, `core/**`, **all** `deployment/**` (including unchanged synthetic `production-contract/**` and dev Compose), **all** existing Gitea workflows, `tests/**` except the one validator source and necessary existing associated README/MINIFEST, package manifests/lockfiles, runner configuration, VPS, DNS, Coolify, Cloudflare, SSL, production secrets/infrastructure and unrelated files. Preserve untracked `AI_INSTRUCTIONS.md`. No local app builds/tests or local Compose execution, Docker `up`/`run`/`build`/`pull`, real DNS/network endpoints or users, new secrets, image registry, production deploy, tags/releases. + +## Evidence-first RCA and exact design + +**Verified from original source** (read-only): `validate_compose()` rejects any normalized service dictionary containing one or more of `build`, `command`, `entrypoint`, `configs`; then a second exact-key allowlist rejects all unknown service keys. Thus it is certain the Run #101 failure arose from at least one of these four fields being present in the `docker compose config --format json` output **for a service**, but the actual offending field and value/type were **NOT logged in Run #101**. Gitea fixture Compose source contains no explicit `build`/`command`/`entrypoint`/`configs` directives and all image refs are `synthetic.invalid`, replicas zero. This is **suggestive of an inert normalization default**, not proof of its precise field; the one approved new CI run must capture safe field-name/type/null-or-empty evidence. + +Only in `validate.py`: +1. Inspect **only allowlisted field NAMES** `build`, `command`, `entrypoint`, `configs` and a sanitized TYPE/CATEGORY (`NULL`, `EMPTY_LIST`, `EMPTY_STRING`, `LIST`, `DICT`, `STRING`, `NUMBER`, `OTHER`), never raw values, arbitrary keys, environment, credentials, original JSON, URL, tokens or secret references. Print fixed safe diagnostics before applying the field-specific fail-closed gate, keyed to known five service IDs. Unknown field names are not echoed. +2. Support **only non-executable** Compose-normalized optional `command: null`, `entrypoint: null`, `configs: null` or `configs: []` **if real new CI evidence demonstrates those defaults**. Do not accept any `build` field (even null) without separate evidence/approval. Reject all non-null command/entrypoint, and any nonempty configs, build context, unknown runtime keys, actual image deployment, ports, network escape, Docker socket, privileged mode, nonzero replicas. Enforce the remaining original exact service allowlist after excluding only verified inert fields. +3. Preserve exact original **25 independent negative fixtures** and their classification/markers. Add **four** focused separate negative fixtures: nonempty `command`, nonempty `entrypoint`, `build` and nonempty `configs` rejected with `RUNTIME_BEHAVIOR`; require exact class, no false positive. Print distinct original-25 and additional-4 summary PASS markers only if all executed. +4. Ensure any other unexpected normalized field still fails closed; do not relax policy schema, OIDC issuer/callback/PKCE, Login/Console/API h2c, trust-boundary Host/forwarded headers, secrets, zero replicas, private networks, no published ports or workflow safety. +5. Perform one focused source/diff/security audit before dispatch; commit and push exact tested source to Gitea `main`. +6. Exactly **ONE** new separately approved manual `p05-production-contract-dry-run.yml` Gitea run; verify `docker compose config` structural parse, sanitized field evidence, positive and original 25/additional 4 negative gates, `always()` workflow safety, terminal status and runner-owned task cleanup (not a claim to inspect production). **No rerun** if blocked. Note result as PASS/FAIL/NOT EXECUTED. +7. Documentation-only closure: `notes/project/docs` + associated README/MINIFEST, one cumulative exact scope/inventory security audit, remote `main` SHA verification. Distinguish **source tested SHA** from docs-final SHA. No production HTTPS DNS/SSL, real certificates, real secrets/backups, Login/Console/MFA/SSO acceptance in this scope. + +**Status on scope-note creation:** implementation not yet edited; new CI not yet dispatched. Actual offending normalized key/type **UNKNOWN** until evidence from the next single run.