From 6e140f9249dbaed5edf7f2cd93e653fee8234be2 Mon Sep 17 00:00:00 2001 From: Md Nurnobi Date: Mon, 23 Nov 2026 12:39:24 +0000 Subject: [PATCH] docs(oidc): record Run 101 normalized Compose rejection and single-run boundary --- docs/P05-OIDC-08.md | 22 ++++++++++++++++++++++ notes/P05-OIDC-08.md | 42 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 docs/P05-OIDC-08.md diff --git a/docs/P05-OIDC-08.md b/docs/P05-OIDC-08.md new file mode 100644 index 0000000..5fc9e73 --- /dev/null +++ b/docs/P05-OIDC-08.md @@ -0,0 +1,22 @@ +# P05-OIDC-08 — Synthetic Production Configuration Contract Dry-Run + +**Terminal outcome:** [Gitea Run #101](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/101), Job #217 on source `2ca1b4493bd47209d0c7eabf7453feaeb1f5174a` — **COMPLETED FAILURE**. This is a **CI-only structural policy test**, not live HTTPS/deployment authentication. + +The approved new fixtures are in `deployment/production-contract/` and `tests/ci/production_contract/`. The five service images point to reserved `synthetic.invalid`, replicas are set to 0 and the network is private. The `routing-policy.json` describes **proposed** `https://auth.vib.tools` issuer, separate `https://account.vib.tools` Account portal and exact `/api/auth/callback/zitadel` HTTPS callback. None of these hostnames/certificates or external infrastructure were contacted or verified by the workflow. + +| Check | Run #101 | +| --- | --- | +| Tools and repository checkout | **PASS** | +| `docker compose config --quiet` structural parse | **PASS** | +| Static workflow's manual-only/no Docker lifecycle commands | **PASS** | +| Normalized Compose + policy security validator | **FAIL** `ZITPLANE_P08_FAIL_CLOSED_RUNTIME_BEHAVIOR` | +| Exact normalized field that triggered rule | **UNKNOWN** (logs show only reason class) | +| 25 intended negative tests | **NOT EXECUTED** (positive failed first) | +| CI task container/volume/network cleanup by Gitea | **PASS** in job terminal log | +| Real DNS/TLS/production secrets/images/backup/Account login | **NOT EXECUTED / out of scope** | + +The validator's `RUNTIME_BEHAVIOR` gate disallows certain runtime-oriented keys in Compose normalized JSON, but **which key or value** is responsible was not retained. It may be normalization of an inert default or a disallowed field; a separate narrow RCA is needed. Do not weaken the security rule or treat the unexecuted negatives as passing. + +**Next recommended separately approved phase:** `P05-OIDC-08-A01`, with source WRITE only `tests/ci/production_contract/validate.py`. Add *safe key/type-only* diagnostics and narrowly distinguish harmless normalized defaults from actual runtime commands/build/config, then one new manual CI static dry-run proving positive and negative gates. The fixture, policy, workflow and original applications remain read-only. **No production deployment or live secrets.** + +Detailed terminal CI/source security evidence and exact proposed Scope Lock: [notes/P05-OIDC-08.md](../notes/P05-OIDC-08.md). diff --git a/notes/P05-OIDC-08.md b/notes/P05-OIDC-08.md index 99c2844..844b9d5 100644 --- a/notes/P05-OIDC-08.md +++ b/notes/P05-OIDC-08.md @@ -35,4 +35,44 @@ - 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. +## 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](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/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](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/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.md` committed before source modifications. +- **SOURCE WRITE EXACT:** `tests/ci/production_contract/validate.py` **only**. No change to `deployment/production-contract/compose.ci.yaml`, `routing-policy.json` or the existing manual workflow unless a *separate newly approved* Scope Lock expressly allows it. +- **DOCS WRITE:** `notes/**`, relevant `project/**`, `docs/**`, associated README/MINIFEST if required. +- **STRICT READ-ONLY:** `auth/**`, `users/**`, `core/**`, **both** `deployment/docker/**` and new `deployment/production-contract/**`, all existing `.gitea/workflows/**`, all `tests/**` except the one validator file and associated documentation, package manifests/locks, runner settings, DNS/VPS/Coolify/SSL, production secrets/infrastructure and unrelated files. Preserve untracked `AI_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`/`configs` and 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. +