docs(oidc): record A01 safe PATH boundary source fix and Run 108 queued/no-execution evidence

This commit is contained in:
victorsteele428 committed 2026-11-23 18:09:23 +00:00
1 parent 4452a61b0f
commit 3b582dfc54
2 files changed
+79 -1

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
# P05-OIDC-10-A01 — OCI Environment-Key Boundary RCA (CI Queued)
**Approved baseline:** `195568a8be978304a686c826cdcbf0ab0d36c6a6`. Scope-first note commit `46e2897380b736b970a0b1de15a161c3600abcb6`; only approved source modified: `tests/ci/login_image/provenance.py`. **CI candidate tested source:** `4452a61b0f5a0892399060fd7569231a564bce02`. Existing Run #99/105 successful workflows and Run #106 historical failure unchanged.
## Root cause classification (source evidence vs actual image evidence)
The old unanchored `PAT` credential matcher also matches harmless `PATH` **by string logic**, a source-proven collision. The previous Run #106 intentionally did not reveal the actual environment key, so **PATH as actual rejected key remains UNVERIFIED**. New `provenance.py` uses a finite allowlist of expected benign Node/OCI env names, token-boundary sensitive-key rejection and fixed allowlisted **name-only** diagnostics. Any unknown key is rejected, without logging names or values; credential-bearing `AUTH_SECRET`, `ZITADEL_MASTERKEY`, `LOGIN_CLIENT_PAT`, `ZITADEL_SERVICE_USER_TOKEN`, DB passwords, private/access key names remain fail-closed. Original 12 negatives preserved, 14 newly defined synthetic env negatives plus benign PATH positive — **not yet CI executed**.
## Existing only approved manual CI — current evidence
[Gitea Run #108](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/108), Job #230, exact SHA `4452a61b0f5a0892399060fd7569231a564bce02`; workflow remains `active`. Created 2026-11-23T18:05:23Z. **Last inspection: RUN QUEUED / JOB QUEUED**, job `started_at` unset, no steps/log; actual runner online/labels/capacity/registration **UNKNOWN**.
| Gate | Result |
| --- | --- |
| Pre-source Scope Lock + exact two-path source/security audit | **PASS** |
| New source fix committed and single Run #108 dispatched | **PASS** |
| Immutable Git/OCI pins, frozen PNPM/Next build, nonroot/entrypoint/image ID | **NOT EXECUTED in Run #108** |
| Original 12 provenance negative fixtures | **NOT EXECUTED** |
| New 14 env-security negatives + harmless PATH positive | **NOT EXECUTED** |
| Real image diagnostic proving rejected PATH or another key | **NOT EXECUTED / UNKNOWN** |
| Partial source/base SPDX and unsigned attestation | **NOT EXECUTED** |
| Run #108 always-owned cleanup and runner task cleanup | **NOT EXECUTED** |
| No publishing, Docker service startup or production action | **Only workflow static prohibition verified; Run #108 job not started** |
**Terminal CI ACCEPTANCE: PENDING/BLOCKED, not PASS or FAIL.** No new run, no rerun, no post-CI source patch, no production deployment, no new image generated as of inspection.
**Next proposal (separate approval only):** P05-OIDC-10-A02 read-only runner scheduling RCA and **existing Run #108 terminal acceptance**, not a replacement dispatch. Exact Scope Lock: [notes/P05-OIDC-10-A01.md](../notes/P05-OIDC-10-A01.md). Actual release remains blocked; signed SBOM and real production HTTPS/SSO are separate.
+52 -1
View File
@@ -27,4 +27,55 @@
**Production stop condition remains:** even if CI passes, partial source/base material SPDX and **UNSIGNED** provenance are not a full transitive/OS SBOM, signed registry release or production HTTPS/Console/MFA/SSO acceptance. Production go/no-go remains BLOCKED pending separate phases. **Production stop condition remains:** even if CI passes, partial source/base material SPDX and **UNSIGNED** provenance are not a full transitive/OS SBOM, signed registry release or production HTTPS/Console/MFA/SSO acceptance. Production go/no-go remains BLOCKED pending separate phases.
**Status at Scope Lock commit:** note-first only; exact offending runtime env key still UNKNOWN; no source edit or new CI dispatch. ## A01 source implementation, focused audit and existing CI scheduling evidence
**Scope-first note SHA:** `46e2897380b736b970a0b1de15a161c3600abcb6`, committed before any change to `tests/ci/login_image/provenance.py`. **Exactly one source file** changed; tested source `4452a61b0f5a0892399060fd7569231a564bce02`. Baseline `195568a8be978304a686c826cdcbf0ab0d36c6a6`. Source change was committed to `main` before dispatch. Existing `auth/**`, `users/**`, `core/**`, `deployment/**`, all other tests, `build.sh`, `cleanup.sh`, `provenance-lock.json` and ALL existing workflow YAMLs were **strictly read-only**. Untracked `AI_INSTRUCTIONS.md` remains untouched.
### Verified source-level RCA and security boundary
- Historical [Run #106](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/106) failed `IMAGE_SECRET_ENV_KEY`, without logging the actual key. Old source used `(SECRET|PASSWORD|TOKEN|PAT|MASTERKEY|DATABASE|AUTH_|PRIVATE_KEY)` as **unanchored** substring over environment key names. Standard benign `PATH` **does contain `PAT`** as a prefix, so a false-positive mechanism is **SOURCE VERIFIED**. Whether that exact key caused Run #106 is still **CI NOT VERIFIED** until new run prints a fixed allowlisted PATH marker.
- `classify_oci_env_key()` recognizes complete underscore-separated credential-bearing segments (`AUTH`, `SECRET`, `PASSWORD`, `TOKEN`, `PAT`, `MASTERKEY`, `DATABASE`, `POSTGRES`, `PRIVATE`, `KEY`, `CREDENTIAL`, etc.), rather than accepting arbitrary names containing the string `PAT`. Exact safe allowed names are limited to frozen image's expected `PATH`, `NODE_VERSION`, `YARN_VERSION`, `NODE_ENV`, `HOSTNAME`, `PORT`, `NODE_OPTIONS`, `SSL_CERT_FILE`, `ZITADEL_TLS_ENABLED`, `OTEL_SERVICE_NAME`, `OTEL_EXPORTER_OTLP_PROTOCOL`. Unexpected keys FAIL CLOSED, even without a sensitive token segment.
- `validate_image()` rejects credential-bearing keys (`IMAGE_SECRET_ENV_KEY`), malformed names (`IMAGE_ENV_KEY_FORMAT`), unknown names (`IMAGE_UNEXPECTED_ENV_KEY`), duplicate names (`IMAGE_ENV_DUPLICATE_KEY`), untrusted `NODE_ENV` (`IMAGE_PRODUCTION_ENV`), unsafe image source labels/user/entrypoint/platform. It checks the variable **names only**, never prints or records their values.
- `diagnose_oci_image_env()` prints only **predefined allowed benign key names** such as `ZITPLANE_P10_OCI_ENV_KNOWN_PATH_PRESENT` and `ZITPLANE_P10_OCI_ENV_LEGACY_MATCH_PATH_VERIFIED` if actually present on the inspected OCI image, or **fixed generic classifications** `UNKNOWN_KEY_PRESENT`, `SENSITIVE_KEY_PRESENT`, `INVALID_ENTRY_PRESENT`, `DUPLICATE_KEY_PRESENT`; never arbitrary input keys or values, credentials, entire Docker image-inspect JSON. The old matcher is retained ONLY in this safe forensic classifier, not as a rejection rule.
- The original **12** provenance-security negative cases and `ZITPLANE_P10_ALL_12_PROVENANCE_NEGATIVES_PASS` marker remain defined unchanged. Source adds **14** targeted synthetic env negative cases (nine forbidden credential-bearing key classes, unexpected name, duplicate PATH, malformed entry, invalid name format, production-mode downgrade), plus one **positive harmless PATH acceptance**. **These new cases are SOURCE PRESENT but CI NOT EXECUTED at current queue state**. No local tests were run.
### One focused pre-run source/security/diff audit
**PASS:** Approved baseline→tested source `4452a61b0f5a0892399060fd7569231a564bce02` cumulative diff exactly **two** paths: `notes/P05-OIDC-10-A01.md` and `tests/ci/login_image/provenance.py`. First commit `46e2897380b736b970a0b1de15a161c3600abcb6` precedes source. All other source/workflow/runtime/production paths unchanged; original 12 negatives preserved; finite diagnostic markers, allowlisted only; no network/registry/prod actions added. Recursive tree returned >1000 total directory+file entries, so both pages were consulted; no missing file/path inferred from the first page's `truncated:true`. This is source/diff audit, **not CI test pass**.
### Single approved CI dispatch and latest observed status
**Dispatched exactly ONE new manual workflow**, the unchanged `.gitea/workflows/p05-login-provenance.yml`, on `main`: [Gitea Run #108](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/108) / Job #230, event `workflow_dispatch`, **tested source `4452a61b0f5a0892399060fd7569231a564bce02`**, created 2026-11-23T18:05:23Z (2026-11-24 00:05:23 Asia/Dhaka). **Last read-only inspection: Run #108 QUEUED, Job #230 QUEUED; `started_at` unset, job step list empty, no job log.** Workflow is **active**. Runner online/offline/label match/capacity/registration remains **UNKNOWN**; no runner-management interface or authorized change used. A queued run is not a CI success or failure. **NO SECOND DISPATCH, NO RERUN, NO POST-RUN SOURCE PATCH.**
| Exact gate | Actual observed A01 outcome |
| --- | --- |
| Scoped first commit, exact two-path pre-CI security audit, source change committed | **PASS — Git/source read-only evidence** |
| Correct single manual Run #108 dispatch on exact source `4452a61b0f5a0892399060fd7569231a564bce02` | **PASS — queued job recorded** |
| Required runner `ubuntu-latest` availability, capacity, registration, scheduled job | **UNKNOWN / QUEUED** |
| Check out source and immutable source/OCI pins | **NOT EXECUTED** |
| Original 12 negative fixtures | **NOT EXECUTED** |
| A01 14 extra credential/env negatives + harmless PATH positive | **NOT EXECUTED** |
| Real OCI allowlisted `PATH` legacy-collision diagnostic, exact offending previous key | **NOT EXECUTED / UNKNOWN** |
| Frozen PNPM/Next source-built Login, pinned runtime/builder, entrypoint and nonroot/label checks | **NOT EXECUTED** |
| Partial SPDX materials and unsigned attestation written to temporary owned context | **NOT EXECUTED** |
| Run #108 exact cleanup and Gitea runner owned task cleanup | **NOT EXECUTED** |
| No image publish/production access configured in unchanged workflow | **SOURCE-LEVEL PASS**; execution NOT STARTED |
| Historic Run #99 Login disposable OIDC, Run #105 static 48/48 security, Run #106 pinned local build/cleanup | **HISTORICAL CI ACCEPTANCE unchanged; not new A01 evidence** |
**A01 current acceptance verdict: SOURCE IMPLEMENTATION + SCOPE AUDIT PASS, CI ACCEPTANCE PENDING / BLOCKED BY QUEUED RUN #108.** No source fix is accepted as actually working against a real OCI image until the same run reaches terminal status with complete logs. If Run #108 later fails, preserve fail-closed policy: no post-run source patch or rerun under this approval. Do not describe production image provenance as certified.
### Next independently approvable Scope Lock — P05-OIDC-10-A02
**Title:** Runner Scheduling RCA & Existing Run #108 Terminal Provenance Acceptance, **read-only first**.
**Baseline:** exact verified A01 final Gitea main docs SHA after closure; A01 tested source `4452a61b0f5a0892399060fd7569231a564bce02`; **existing Run #108 / Job #230** must be checked, **not dispatched again**.
1. Commit `notes/P05-OIDC-10-A02.md` Scope Lock **before other documentation changes**; source tree, workflows and external infrastructure **strictly read-only**.
2. Use existing Gitea run/job/log + available **read-only** runner evidence to determine runner online/offline, `ubuntu-latest` label matching, registration and busy capacity; if unavailable record **UNKNOWN** and do not infer offline. Do not change runner or server settings.
3. If existing Run #108 executes, inspect exactly its terminal status, safe PATH classifier, original 12+extra 14 negative fixtures, frozen Login/OCI nonroot, image ID, partial SPDX/unsigned local attestation and `always()` run-owned + runner cleanup. Record every PASS/FAIL/NOT EXECUTED. If already completed, do not create a new run. If still queued, report QUEUED and leave untouched.
4. **No new CI dispatch/rerun**, no source/runner/workflow edits, no Docker build/manual execution, registry publishing, live DNS/TLS/secrets/users, deployment, tag or release. Existing `AI_INSTRUCTIONS.md` untouched.
5. **Documentation write only:** `notes/**`, relevant `project/**`, relevant `docs/**`, associated README/MINIFEST as required. Focused documentation/security/diff audit, reconcile exact tracked inventory, commit/push final Gitea main and report exact baseline/head. If runner action is truly necessary, propose a **separate** narrow permissioned approval—do not silently change runner state.
6. Production gate remains BLOCKED even after successful CI: partial unsigned SBOM is not full OS/dependency SBOM, signed release, public HTTPS/SSO/MFA/Console or backup recovery.
**P05-OIDC-10-A02 is PROPOSED only; not yet approved or executed.**