diff --git a/.gitea/workflows/README.md b/.gitea/workflows/README.md index c1445e1..8136f37 100644 --- a/.gitea/workflows/README.md +++ b/.gitea/workflows/README.md @@ -10,7 +10,7 @@ Job responsibilities: **P05-CI-02 additions:** Account Portal CI negative route/API smoke, npm/pnpm structured Moderate advisory detail, and disposable Postgres restart persistence plus stronger OIDC issuer/JWKS negative checks. Run #83 passed Account, Login V2 and Security jobs but backend proxy bind to shared host port 8080 failed after Postgres/ZITADEL/Login healthy. **Post-run source fix:** all backend Compose calls include `tests/ci/compose.portless.override.yaml` (`ports: !reset []`), config rejects any published proxy port; this is not CI-verified. Full authenticated user sign-in/MFA remains deferred. -**P05-SEC-01:** `.gitea/workflows/p05-security-acceptance.yml` is **manual-only** with independent Account frozen build + negative access regressions, Login frozen Nx build + Vitest, Account production audit and Login production audit. Both security jobs require the previous HIGH/CRITICAL gate and a separate STRICT zero Moderate/High/Critical threshold from `tests/ci/security_advisory_gate.py`; any remaining Moderate advisory blocks the security phase. No source authentication changes, deployment or secret use. See `docs/P05-SEC-01.md`. +**P05-SEC-01:** `.gitea/workflows/p05-security-acceptance.yml` is **manual-only** with independent Account frozen build + negative access regressions, Login frozen Nx build + Vitest, Account production audit and Login production audit. **Run #87:** Account build, Login build/1219 unit tests, Account security audit **PASS**; Login audit **FAIL** on 2 Moderate transitive `glob`/`minimatch` findings (0 High/Critical) as required by strict `tests/ci/security_advisory_gate.py`. No source auth changes or production deployment. See `docs/P05-SEC-01.md`. **P05-CI-03:** `p05-backend-acceptance.yml` runs **only** the isolated backend job with `tests/ci/backend_acceptance.sh` and always-run `backend_cleanup.sh`. **Gitea Run #86 SUCCESS** on `03fb589`: portless config, all four services, restart persistence, ready/discovery/JWKS, negative cases and complete cleanup passed. No Account/Login build rerun; no production. See `docs/P05-CI-03.md`. diff --git a/README.md b/README.md index 70492fa..696926a 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Compact, developer-friendly monorepo for a central identity service, a branded l - **P05-CI-01:** Manual Gitea Run #81 **overall FAILURE**: Login V2 build + 1219 unit tests PASS, high/critical gate PASS (18 Moderate Login findings), Account Auth.js TS2345 and Docker checkout FAIL. Details: `docs/P05-CI-01.md`. - **P05-CI-02:** Gitea Run #83 **3 PASS / 1 FAIL**. Account Portal typecheck/build and negative identity checks PASS; Login V2 build + 1219/1219 tests PASS; High/Critical security threshold PASS (18 Moderate Login records + 1 Moderate Account package OPEN). Docker Postgres/ZITADEL API/Login healthy, but shared runner port 8080 blocked Traefik; cleanup PASS. CI-only portless override added afterward **not CI-verified**; full OIDC E2E deferred. See `docs/P05-CI-02.md`. - **P05-CI-03:** **Gitea Run #86 SUCCESS** on `03fb589`: portless Docker Compose, four healthy/running services, PostgreSQL restart persistence, ZITADEL readiness, OIDC discovery/JWKS, negative contracts and complete CI cleanup verified. No repeated Account/Login suites. Full interactive OIDC E2E and Moderate dependency fixes remain pending. See `docs/P05-CI-03.md`. -- **P05-SEC-01:** Security dependency patch candidates prepared: Account/Login Next.js `16.4.6`, coordinated Login OpenTelemetry `0.80.0/0.222.0`; generated npm/pnpm lock metadata without local application installs/builds/tests. Two transitive `glob`/`minimatch` Moderate advisories remain potential blockers pending exact registry CI; dedicated manual workflow has strict zero-Moderate gate. See `docs/P05-SEC-01.md`. +- **P05-SEC-01:** Gitea Run #87 **3 PASS / 1 FAIL**. Account and Login patched Next.js `16.4.6` builds PASS, Login 1219/1219 upstream unit tests PASS, Account audit 0. Login OpenTelemetry patched dependencies reduced prior 18 Moderate to **2 remaining** (glob/minimatch); strict Moderate security gate correctly FAILS. Current dependency patch retained; complete security acceptance requires a separate narrow transitive remediation phase. See `docs/P05-SEC-01.md`. - **Production / Coolify:** not configured or deployed. ## Documentation and project knowledge diff --git a/docs/FEATURES-STATUS.md b/docs/FEATURES-STATUS.md index eac5e06..f2420bd 100644 --- a/docs/FEATURES-STATUS.md +++ b/docs/FEATURES-STATUS.md @@ -17,8 +17,8 @@ Snapshot: 2026-11-22, **Gitea P05-CI-03 Run #86 backend-only SUCCESS** on `03fb5 | Mutable profile editing / device sessions / identity deletion | No | N/A | No | | Global ZITADEL SSO logout | No | N/A | No | | Subscriptions, payments and SaaS billing | Outside ZitPlane scope | N/A | No | -| Gitea Actions CI verification workflow | Yes, P05 manual dispatch | Run #83 Account/Login/Security baseline, Run #86 backend-only SUCCESS; P05-SEC-01 patched dependency workflow pending | Not deployed | -| Dependency Moderate security patch/acceptance | P05-SEC-01 manifest and lockfile candidates; strict independent CI gates | **NOT YET CI VERIFIED**: original 18 Login Moderate records and 1 Account package; glob/minimatch likely unresolved | Not deployed | +| Gitea Actions CI verification workflow | Yes, P05 manual dispatch | Run #83 baseline, Run #86 backend SUCCESS, Run #87 3 PASS/1 FAIL (2 Moderate Login advisories) | Not deployed | +| Dependency Moderate security patch/acceptance | Account/Login Next.js and OTel patched manifests/locks, strict CI acceptance | Run #87: Account 0, Login 2 Moderate (`glob`, `minimatch`), High/Critical 0; **security acceptance BLOCKED** | Not deployed | | Gitea Actions CI and isolated integration tests | Backend-only workflow; interactive identity E2E remains absent | **Run #86 PASS:** disposable backend OIDC ready/discovery/JWKS, Postgres persistence, cleanup; authenticated user E2E pending | No | | Coolify production stack, TLS, routing and backups | No | No | No | | Public `auth.vib.tools/login` URL | Proposed only | No | No | diff --git a/docs/MINIFEST.md b/docs/MINIFEST.md index aae1fb4..3cad525 100644 --- a/docs/MINIFEST.md +++ b/docs/MINIFEST.md @@ -10,7 +10,7 @@ Every file listed below is a direct child of `docs/`. Add/remove rows whenever t | [P05-CI-01.md](P05-CI-01.md) | Gitea Actions manual verification workflow, gates, limitations and real run evidence | P05-CI-01 / Run #81 complete, acceptance blocked | | [P05-CI-02.md](P05-CI-02.md) | TypeScript remediation, Gitea CI verification, dependency risk and isolation evidence | P05-CI-02 / run #83 done; Docker acceptance blocked | | [P05-CI-03.md](P05-CI-03.md) | Isolated backend-only Gitea CI procedure, checks and exact run outcomes | P05-CI-03 / Run #86 SUCCESS | -| [P05-SEC-01.md](P05-SEC-01.md) | Source-grounded dependency security patches, advisory blockers and CI verification | P05-SEC-01 / awaiting Gitea CI | +| [P05-SEC-01.md](P05-SEC-01.md) | Source-grounded dependency security patches, advisory blockers and CI verification | P05-SEC-01 / Run #87 3 PASS/1 FAIL, 2 Moderate open | | [SETUP-GUIDE.md](SETUP-GUIDE.md) | Operator/developer prerequisites, configs, activation and safety | DOCS-01 / active; runtime pending | | [FEATURES-STATUS.md](FEATURES-STATUS.md) | Exact implemented/unavailable/unverified feature matrix | DOCS-01 / active | | [TROUBLESHOOTING.md](TROUBLESHOOTING.md) | Known blockers and safe diagnosis based on source status | DOCS-01 / active | diff --git a/docs/P05-SEC-01.md b/docs/P05-SEC-01.md index 02fa097..83c0059 100644 --- a/docs/P05-SEC-01.md +++ b/docs/P05-SEC-01.md @@ -2,7 +2,7 @@ **Date:** 2026-11-22 **Approved baseline:** `1a602551ad9a791efcc594834f2fa6ce748339ae` -**State:** Source patch prepared; one focused Gitea security CI cycle pending. +**State:** **Run #87 complete: 3 PASS / 1 FAIL.** Account/ Login builds and Account audit PASS; Login audit correctly FAILS on 2 remaining Moderate transitive advisories. ## Scope and goals @@ -41,4 +41,4 @@ Separate build and audit jobs preserve useful evidence even if remaining advisor **Security acceptance requires both dependency audits at zero Moderate/High/Critical, frozen installs and application builds/tests PASS**, with exact evidence and no out-of-scope changes. A nonzero Moderate finding is explicitly a **BLOCKED** gate even when build jobs PASS. -**PENDING REAL CI:** run ID, SHA, individual job results, current vulnerabilities and follow-up needed. Full authenticated OIDC callback, MFA, Admin Console login, global SSO and production deployment are outside this phase. See `notes/P05-SEC-01.md` for pre-change plan/closure log. +**ACTUAL CI:** [Gitea Run #87](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/87), tested `752d243ae8fb24ce3cfa990343082e2d0431306b`, **overall FAILURE — 3 PASS / 1 FAIL**. Account frozen install, TypeScript, Next.js production build and negative identity regressions PASS. Login pinned pnpm frozen install, original proto/client/Login production build and **84/84 files, 1219/1219 upstream unit tests PASS**. Account npm audit **zero vulnerabilities**. Login pnpm audit **zero High/Critical** but **2 Moderate**: `GHSA-3g3m-2fjr-6pw4` (`glob`, patched >=14.0.2) and `GHSA-g3hv-75wg-m249` (`minimatch`, patched >=11.0.1). Strict Moderate+ gate correctly failed. Previous 19 findings reduced to **2** (17 no longer reported). **Security phase is PARTIALLY REMEDIATED / ACCEPTANCE BLOCKED**, not a production release. Full authenticated OIDC callback, MFA, Admin Console login, global SSO and deployment remain outside scope. See `notes/P05-SEC-01.md` for exact job evidence and proposed narrow follow-up. diff --git a/docs/PHASES.md b/docs/PHASES.md index abea4b3..debc993 100644 --- a/docs/PHASES.md +++ b/docs/PHASES.md @@ -57,7 +57,7 @@ Implement one explicitly approved phase at a time. Keep out-of-scope files, exis - Baseline `1a602551ad9a791efcc594834f2fa6ce748339ae`. Previous Run #83 security: 18 Moderate Login advisory records and 1 Moderate Account vulnerable Next.js package; Run #86 backend-only SUCCESS. - Narrow approved manifest writes: `users/ui/{package.json,package-lock.json}`, `auth/ui/v2/apps/login/package.json`, root `auth/ui/v2/{package.json,pnpm-lock.yaml}` only if justified; new `.gitea/workflows/p05-security-acceptance.yml`, focused `tests/ci/**`, notes/project/docs and associated README/MINIFEST. **`pnpm-workspace.yaml`, application source, Go backend, developer Compose, production and unrelated files remain read-only.** - Direct Next.js pinned 16.4.6; Login coordinated OTel auto-instrumentation 0.80.0 / SDK 0.222.0 family, PNPM/npm metadata-only lockfile reconciliation. Root overrides are read-only, so glob14/minimatch11 major transitive remediation remains an explicit blocker if registry audit reproduces it. -- Dedicated manual Gitea CI: independent Account/Login frozen installs and builds/regressions, plus separate fail-closed HIGH+ gates and **zero Moderate/High/Critical** gates. Exactly one run, accurate unresolved audit evidence; no local app build/test/dev server or production deployment. Details: `notes/P05-SEC-01.md`, `docs/P05-SEC-01.md`. +- **Gitea Run #87**, tested SHA `752d243ae8fb24ce3cfa990343082e2d0431306b`: 3 job PASS (Account npm frozen typecheck/build/anonymous regressions, Login pnpm frozen Nx build + 1219/1219 unit tests, Account security 0), Login security FAIL on 2 Moderate transitive advisories (`glob` and `minimatch`), High/Critical 0. Prior 19 reported records reduced to 2; **full security acceptance BLOCKED**. Only one CI run, no local app build/test/dev server, no backend/production change. Exact result: `notes/P05-SEC-01.md`, `docs/P05-SEC-01.md`. ## P05 - Full Integration (proposed, NOT approved) Shared design system, production-safe Compose topology and verified Login/Account OIDC wiring. No live deployment; separate approval. diff --git a/docs/README.md b/docs/README.md index 8e4a497..5800d3a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -26,4 +26,4 @@ Full update policy is in root [AGENTS.md](../AGENTS.md). A list of available docs is in [MINIFEST.md](MINIFEST.md). -For dependency security patches and remaining audit blockers see [P05-SEC-01.md](P05-SEC-01.md). For backend-only isolated runtime verification see [P05-CI-03.md](P05-CI-03.md); for initial full workflow and its limitations see [P05-CI-01.md](P05-CI-01.md). A green backend discovery smoke is not an authenticated user-login result. +For Gitea Run #87 security patch evidence and its two remaining Moderate advisory blockers see [P05-SEC-01.md](P05-SEC-01.md). For backend-only isolated runtime verification see [P05-CI-03.md](P05-CI-03.md); for initial full workflow and its limitations see [P05-CI-01.md](P05-CI-01.md). A green backend discovery smoke is not an authenticated user-login result. diff --git a/docs/SETUP-GUIDE.md b/docs/SETUP-GUIDE.md index af7d4d1..583259e 100644 --- a/docs/SETUP-GUIDE.md +++ b/docs/SETUP-GUIDE.md @@ -81,3 +81,6 @@ In Gitea `vibtools/ZitPlane` → **Actions** → **ZitPlane P05-CI-03 Backend Ac ## P05-SEC-01 security acceptance on Gitea (manual only) On Gitea `vibtools/ZitPlane` open Actions → `ZitPlane P05-SEC-01 Dependency Security Acceptance` → Run workflow on `main` **after** the approved source commit is pushed. Jobs use fresh CI runner containers, immutable committed npm/pnpm locks, and no production identity credentials. Account/official Login V2 reproducible builds and unit/negative regressions run separately from Account and Login registry audits. Audits fail if there is **any** Moderate, High or Critical finding; the script prints exact advisory IDs so an outstanding transitive dependency can be fixed in another explicit Scope Lock. The P02 developer Compose, local Windows PC and production Coolify are not modified. See `docs/P05-SEC-01.md` and `project/DEPENDENCY-SECURITY.md`. + + +**P05-SEC-01 actual evidence:** [Run #87](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/87) verified Account/Login frozen dependency installs, production builds and **1219/1219** Login unit tests; the Account security audit is clean. However Login `glob` and `minimatch` each still have one Moderate advisory, and the strict security job correctly **failed**. Production usage and package-security acceptance remain blocked until separate transitive-remediation approval and CI. No local application tests or deployment. diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.md index b0904c5..174e60d 100644 --- a/docs/TROUBLESHOOTING.md +++ b/docs/TROUBLESHOOTING.md @@ -30,3 +30,8 @@ Include environment (local disposable vs CI vs production), exact phase/commit, ## Known limitations Account Portal and Login V2 build CI passed in Run #83, disposable backend acceptance passed in Run #86, and dependency lockfiles/workflows exist. **Real authenticated OIDC callback/positive session, MFA/passkey, Admin Console human login, production Coolify/TLS/backup and production support remain UNVERIFIED.** Preserve the Scope Lock in `notes/` and ZITADEL security boundaries. + + +## P05-SEC-01 exact security-blocker troubleshooting + +Gitea Run #87 produced 3 PASS and 1 FAIL. The FAILED `security_login` job is a **deliberate fail-closed Moderate threshold**: `GHSA-3g3m-2fjr-6pw4` in `glob` (fix >=14.0.2) and `GHSA-g3hv-75wg-m249` in `minimatch` (fix >=11.0.1). Account npm audit returned 0. Login's earlier Next.js/OTel advisories no longer reproduce, its frozen build and 1219 tests PASS, and High/Critical remain 0. Do not turn off auditing, ignore Moderate reports, modify protected auth code or force incompatible package majors. A separate P05-SEC-02 exact Scope Lock must allow controlled PNPM workspace overrides or verified compatible parent upgrades; only a new focused CI run can close security acceptance. diff --git a/notes/CHANGELOG.md b/notes/CHANGELOG.md index f58cc9a..224a820 100644 --- a/notes/CHANGELOG.md +++ b/notes/CHANGELOG.md @@ -12,6 +12,6 @@ This is the chronological **index**. Phase-specific scope/implementation evidenc | 2026-11-22 | P05-CI-01 | Gitea verification workflow, dependency lock reconciliation, narrow checkout remediation | Run #81: 2 PASS/2 FAIL; 1219 Login tests PASS, Account TS2345 and Docker checkout blocked; see [P05-CI-01.md](P05-CI-01.md) | | 2026-11-22 | P05-CI-02 | Narrow Auth.js TS2345 fix, CI negative tests, advisory triage and post-run portless override | Run #83: Account/Login/Security PASS, Docker FAIL on host 8080; cleanup PASS; portless override unverified. [Evidence](P05-CI-02.md) | | 2026-11-22 | P05-CI-03 | Backend-only Gitea verification of portless Compose, 4 services, Postgres persistence, OIDC/JWKS and safe cleanup | **Run #86 SUCCESS** on `03fb589`, no unrelated suites rerun; [evidence](P05-CI-03.md) | -| 2026-11-22 | P05-SEC-01 | Narrow Next.js 16.4.6 and compatible OTel instrumentation security versions, frozen lockfiles, strict CI advisory gate | Implementation source staged; one Gitea security acceptance run pending; [details](P05-SEC-01.md) | +| 2026-11-22 | P05-SEC-01 | Next.js 16.4.6, compatible OTel instrumentation, frozen locks and strict advisory gates | Run #87: 3 PASS/1 FAIL; 17/19 prior findings no longer reported, 2 Moderate Login blockers. [Evidence](P05-SEC-01.md) | Rules: Append new phases or fixes; never silently rewrite a past result. Separate **implemented**, **verified**, **blocked**, and **proposed**. Never log a user secret or personal data. diff --git a/notes/MINIFEST.md b/notes/MINIFEST.md index b15551b..fa60fa8 100644 --- a/notes/MINIFEST.md +++ b/notes/MINIFEST.md @@ -8,7 +8,7 @@ | [P05-CI-01.md](P05-CI-01.md) | Scope/roots, allowed paths, implementation and Gitea CI acceptance evidence | P05-CI-01 / source complete, CI blockers open | | [P05-CI-02.md](P05-CI-02.md) | Auth.js narrow patch, isolated Gitea CI gate, advisory triage and exact acceptance evidence | P05-CI-02 / run #83 completed; residual Docker gate blocked | | [P05-CI-03.md](P05-CI-03.md) | Backend-only pre-change scope, disposable CI run evidence and exact acceptance result | P05-CI-03 / Run #86 SUCCESS; acceptance complete | -| [P05-SEC-01.md](P05-SEC-01.md) | Pre-change security scope, remediation, exact advisory evidence, one CI run and closure | P05-SEC-01 / source prepared, CI pending | +| [P05-SEC-01.md](P05-SEC-01.md) | Pre-change security scope, remediation, exact advisory evidence, one CI run and closure | P05-SEC-01 / Run #87 completed, 2 Moderate open | | [CHANGELOG.md](CHANGELOG.md) | Short append-only chronological phase log and links to detailed reports | DOCS-01 / active | Update this manifest whenever any direct child file or directory changes. Use **actual source state**; a planned file must be labeled planned, not present. diff --git a/notes/P05-SEC-01.md b/notes/P05-SEC-01.md index 3deabbf..0e6c564 100644 --- a/notes/P05-SEC-01.md +++ b/notes/P05-SEC-01.md @@ -2,7 +2,7 @@ **Date:** 2026-11-22 **Approved baseline:** `1a602551ad9a791efcc594834f2fa6ce748339ae` (Gitea `main`) -**Pre-change status:** APPROVED / PLAN LOCKED; source edits not started. +**Final status:** PATCH IMPLEMENTED; one focused Gitea Run #87 completed **3 PASS / 1 FAIL**. Security acceptance **BLOCKED** by 2 Moderate Login transitive advisories; documentation-only closure. **Prior evidence:** Gitea Run [#83](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/83) security job #173; Run [#86](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/86) disposable backend ACCEPTED. ## Exact Scope Lock @@ -45,3 +45,34 @@ Root source pins `next@16.4.3`; npm registry advisory shows vulnerable 16.0.0– ## Phase evidence ledger **PENDING.** Update with actual modifications and one focused CI run SHA/job conclusions. If Moderate remain, security closure must stay **BLOCKED**, not silently accepted. + + +## Actual implementation, CI evidence and acceptance — 2026-11-22 + +**Source commit:** `752d243ae8fb24ce3cfa990343082e2d0431306b` pushed to Gitea `main` before dispatch. +**ONE focused run:** [#87](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/87), `workflow_dispatch`, `main`, tested exact SHA above. Started 2026-11-22 14:08:50 UTC, completed 14:12:42 UTC. **OVERALL FAILURE** by design due remaining Moderate Login advisories; **3 PASS / 1 FAIL**, no second run. + +| Job | Gitea job ID | Final | Real log markers/evidence | +| --- | ---: | --- | --- | +| Account frozen build | 185 | **PASS** | `ZITPLANE_SECURITY_SOURCE_LOCK_CONTRACT_PASS`, npm ci, `tsc --noEmit`, Next `16.4.6` production build, `ZITPLANE_SECURITY_ACCOUNT_BUILD_PASS`; anonymous API HTTP 401/no-store and protected redirect `ZITPLANE_SECURITY_ACCOUNT_NEGATIVE_REGRESSIONS_PASS` | +| Official Login V2 frozen build/unit | 186 | **PASS** | `pnpm@10.30.3 install --frozen-lockfile` resolved **1131** packages, `ZITPLANE_SECURITY_LOGIN_FROZEN_INSTALL_PASS`; Nx proto/client/Next `16.4.6` standalone build `ZITPLANE_SECURITY_LOGIN_BUILD_PASS`; **84/84 files, 1219/1219 tests PASS**, `ZITPLANE_SECURITY_LOGIN_UNIT_PASS` | +| Account production security | 187 | **PASS** | npm `--omit=dev`, `0 vulnerabilities`; `ZITPLANE_NPM_ZERO_MODERATE_HIGH_CRITICAL_PASS`; Moderate=0, High=0, Critical=0 | +| Login production security | 188 | **FAIL (strict gate)** | `pnpm audit --prod --audit-level high` PASS High/Critical threshold; registry reports **2 Moderate**, 0 High/Critical. `ZITPLANE_PNPM_SECURITY_ACCEPTANCE_BLOCKED=2` correctly terminates the job | + +### Exact remaining findings — verified on Run #87 + +1. **`GHSA-3g3m-2fjr-6pw4` — `glob`**, Moderate. Current lock includes `glob@10.5.0`; advisory range >=9.0.0 <=14.0.1; patched **>=14.0.2**. Prior lock immediate parents: `@npmcli/map-workspaces@3.0.6`, `@npmcli/package-json@5.2.1`, `rimraf@5.0.10`, `archiver-utils@5.0.2`, `unified-engine@11.2.2`. Transitive major-version compatibility not proved. +2. **`GHSA-g3hv-75wg-m249` — `minimatch`**, Moderate. Current lock includes `minimatch@10.2.5/10.2.6`; advisory range >=7.0.0 <11.0.1; patched **>=11.0.1**. Immediate parents include `eslint@10.8.1`, `@eslint/config-array@0.23.5`, `@typescript-eslint/typescript-estree@8.67.0`, `nx@22.7.12`. Forcing major 11 needs scoped parent/PNPM override compatibility verification. + +The original 18 Moderate Login advisory records are now **2** (16 disappeared from registry audit: Next.js seven + OpenTelemetry 9); original Account one affected `next` package is now zero. **17 of the 19 previously reported records no longer reproduce**; do not imply these 17 correspond to 17 distinct CVEs. No High/Critical reported on either audit. **Security FULL ACCEPTANCE BLOCKED** until remaining two are remediated and CI-reverified. + +### Scope/patch provenance and safety + +- Only approved `users/ui/{package.json,package-lock.json}`, `auth/ui/v2/apps/login/package.json` and `auth/ui/v2/pnpm-lock.yaml` changed among application/workspace files. +- Next exact `16.4.6` (both apps) and Login `@next/eslint-plugin-next` `16.4.6`; Login `@opentelemetry/auto-instrumentations-node@^0.80.0`, `@opentelemetry/sdk-node@^0.222.0`, `@opentelemetry/api-logs@^0.222.0`. Original Login V2 **auth/UI source**, Account `src/**`, developer Compose, Go backend, `pnpm-workspace.yaml` and production unchanged. +- npm/pnpm lock files were regenerated metadata-only, without project `node_modules` or local build/test. Full imported upstream lock pruning removed 912 unused prior package key entries and introduced 88 new resolution entries; CI `--frozen-lockfile` **PASS** and all 1,219 unit regressions PASS. +- Source-level audit: 29 approved staged files, 0 unauthorized, 0 secrets; 729 Git-tracked paths inventoried; all five relevant MINIFEST direct-child inventories exact. `AI_INSTRUCTIONS.md` untracked and untouched. +- **No second Gitea run**, no local application builds/tests/dev server, no real users, no production deployment, no dependency versions beyond documented scope. +- `auth/ui/v2/pnpm-workspace.yaml` is **read-only in this phase** and already owns PNPM root overrides. Do not place ineffective overrides in root `package.json` or force semver majors as an undocumented workaround. Future **P05-SEC-02** must explicitly approve narrow PNPM workspace override/parent changes and CI proofs, with a new baseline. + +**Final verdict:** Minimal security remediation source patch and regression verification **DONE**, full Moderate+ security acceptance **BLOCKED** by exactly two named packages. The final documentation-only SHA is *not* the tested source SHA `752d243`. diff --git a/project/CHANGELOG.md b/project/CHANGELOG.md index 28a318b..f1b7416 100644 --- a/project/CHANGELOG.md +++ b/project/CHANGELOG.md @@ -12,7 +12,7 @@ This is the **developer-focused implementation history**. `notes/CHANGELOG.md` i | 2026-11-22 | P05-CI-01 | `.gitea/workflows/p05-ci.yml`, `tests/ci/**`, Account npm lock, Login pnpm importer reconciliation and in-scope Alpine Git checkout correction | Run #81 overall FAIL; 2 jobs PASS, 2 FAIL; Login 1219/1219 tests PASS, Account TS2345 and Docker checkout blocked; `notes/P05-CI-01.md` | | 2026-11-22 | P05-CI-02 | Type-safe Auth.js subject narrowing, Account anonymous negative tests, Login regression, structured advisory triage and CI-only portless Docker override | Run #83: 3 PASS/1 FAIL; Docker proxy 8080 collision, cleanup PASS, portless fix unverified; see `notes/P05-CI-02.md` | | 2026-11-22 | P05-CI-03 | Dedicated manual backend-only CI acceptance, guarded disposable Compose, persistence/ready/JWKS probes and owned-state cleanup | **Gitea Run #86 SUCCESS** on `03fb589`; all steps PASS; `notes/P05-CI-03.md` | -| 2026-11-22 | P05-SEC-01 | Next.js/OTel minimal security manifest and metadata-only locks; strict Moderate+ audits and build/regression CI; no app/UI source modifications | Source under review, one Gitea CI cycle pending; `notes/P05-SEC-01.md` | +| 2026-11-22 | P05-SEC-01 | Next.js/OTel minimal security manifests, reproducible locks, dedicated CI and strict Moderate+ gates | Run #87: Account/Login build PASS, Login Vitest 1219/1219, Account audit 0, Login 2 Moderate open; `notes/P05-SEC-01.md` | ## Required entry for each future change diff --git a/project/CI-ARCHITECTURE.md b/project/CI-ARCHITECTURE.md index aef9395..f52497f 100644 --- a/project/CI-ARCHITECTURE.md +++ b/project/CI-ARCHITECTURE.md @@ -91,3 +91,8 @@ Manual Gitea-only `.gitea/workflows/p05-security-acceptance.yml` has four indepe Each registry job first runs `npm audit --omit=dev --audit-level=high` or `pnpm audit --prod --audit-level high` under `set -eu` to fail-closed on High/Critical. Then nonmutating JSON is collected, `tests/ci/advisory_triage.py` prints exact IDs/package/range/fix, and `tests/ci/security_advisory_gate.py` requires complete/count-consistent JSON and **zero Moderate/High/Critical**. Any Moderate is an actual failed gate, not a warning disguised as acceptance. Only approved manifest and lockfile metadata were patched; original Login/auth/API/UI source, `pnpm-workspace.yaml`, P02 backend, Compose, real credentials and production unchanged. Two transitive glob/minimatch risks may remain because the root PNPM override configuration is outside Scope Lock and those require semver-major upgrades. See `project/DEPENDENCY-SECURITY.md` for the original 18+1 records and exact immediate parents; source state is not proof of advisory resolution until actual Gitea run. + + +## P05-SEC-01 Run #87 terminal job results + +Manual [Run #87](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/87) tested `752d243`. Account job #185 PASS; Login job #186 PASS (frozen pnpm, Nx Next 16.4.6 build and 1219 unit cases); Account security job #187 PASS at all levels with 0 findings; Login security job #188 FAIL on **two Moderate** `glob`/`minimatch` advisories (0 High/Critical). The strict `tests/ci/security_advisory_gate.py` did not suppress them, so **overall run FAILURE** is expected and correct. Full source/security acceptance remains blocked pending a separate narrow transitive dependency phase; no repeated run or application source change. diff --git a/project/DEPENDENCY-SECURITY.md b/project/DEPENDENCY-SECURITY.md index 82a480a..7486db1 100644 --- a/project/DEPENDENCY-SECURITY.md +++ b/project/DEPENDENCY-SECURITY.md @@ -38,4 +38,18 @@ This table identifies **immediate parents present in the archived PNPM lock grap Expected patched direct candidates: Next.js `16.4.6` both apps; Login `@opentelemetry/auto-instrumentations-node@0.80.0`, `@opentelemetry/sdk-node@0.222.0`, `@opentelemetry/api-logs@0.222.0`. **OPEN candidate blockers:** glob >=14.0.2, minimatch >=11.0.1 require separately approved scoped parent/override changes. -**CI PENDING:** live audit may expose new or unchanged vulnerabilities; never declare zero Moderate from manifest text alone. The follow-up result record will list all remaining exact IDs, job statuses and a separate narrow remediation plan. +**CI VERIFIED in Run #87:** the live registry audit did report two unchanged Moderate transitive vulnerabilities (`glob`, `minimatch`). See the terminal outcome section below. No claim of full security acceptance. + + +## Gitea Run #87 verified outcome — 2026-11-22 + +**Tested SHA:** `752d243ae8fb24ce3cfa990343082e2d0431306b`. +**Run:** https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/87, **overall FAILURE** (3 job PASS/1 security job FAIL), manual only. + +- **Account:** pinned npm v3 lock frozen install, Next.js 16.4.6/TypeScript production build and anonymous negative identity regressions PASS. Production npm audit **0 vulnerabilities** (0 Moderate/High/Critical), job #187 PASS. +- **Login:** pinned pnpm v10.30.3 **frozen install** (1131 packages), Nx proto/client/Next.js 16.4.6 standalone build PASS; upstream Vitest **84/84 test files, 1219/1219 unit tests PASS**. Its production pnpm audit had **zero High/Critical**, but **2 Moderate**; job #188 intentionally FAIL due fail-closed zero-Moderate gate. +- **Still open:** `GHSA-3g3m-2fjr-6pw4` (`glob`, upgrade >=14.0.2) and `GHSA-g3hv-75wg-m249` (`minimatch`, upgrade >=11.0.1). Immediate parent version constraints remain incompatible with blind semver-major upgrades. The authoritative PNPM workspace override file is read-only in P05-SEC-01. +- **No longer reported:** 7 old Next.js Login records, 9 old OpenTelemetry Login records, 1 old Account `next` vulnerable package record — 17/19 original records disappeared from current registry audit. This is not proof of runtime exploitability or of zero future advisories. +- Remaining P05-SEC-02 focus: narrow authorized `auth/ui/v2/pnpm-workspace.yaml` overrides or compatible parent dependency upgrades, reproducible pinned lock, exact transitive resolution and fail-closed Gitea frozen/security/build/unit acceptance. No login/auth/UI source changes. + +**P05-SEC-01 classification: PATCH IMPLEMENTED AND BUILDS PASS; SECURITY ACCEPTANCE BLOCKED, not a production release.** Final docs-only SHA differs from the tested Run #87 source SHA. diff --git a/project/SETUP-AND-DEPENDENCIES.md b/project/SETUP-AND-DEPENDENCIES.md index 5753ff1..15ed88b 100644 --- a/project/SETUP-AND-DEPENDENCIES.md +++ b/project/SETUP-AND-DEPENDENCIES.md @@ -63,3 +63,6 @@ Run #86 on commit `03fb589` executed a backend-only manual Gitea Actions job and - The imported PNPM lock previously retained snapshots from an upstream monorepo larger than the 4-member ZitPlane workspace. Regeneration pruned many no-longer-reachable snapshots, with only metadata file changes inside approved scope; root workspace `pnpm-workspace.yaml` and imported code unchanged. The Gitea **frozen install** is the required proof of consistency. - Advisory resolution cannot be claimed merely from versions. `glob@10.5.0` and `minimatch@10.2.x` remain in the lockfile through tooling parents with older major ranges, and the workspace override file is read-only. Their Moderate advisories stay OPEN until proven fixed or separately approved. - Dedicated manual Gitea `p05-security-acceptance.yml` performs Account/Login frozen builds and a strict High/Critical + Moderate gate. Prior P05 backend Run #86 was successful and was **not** deployed. + + +**P05-SEC-01 Gitea verification result:** Run #87 on `752d243` proved both frozen installs and production builds, and the Login upstream unit suite **1219/1219 PASS**. Account production audit returned 0 vulnerabilities. Login production audit returned **2 Moderate transitive issues** (glob 14.x and minimatch 11.x patch lines require compatible override/parent work) and zero High/Critical. The strict Moderate gate **failed as intended**. Do not interpret the patched manifest/lockfile as full vulnerability clearance; P05-SEC-02 needs a newly approved change to the read-only PNPM workspace overrides. diff --git a/project/SOURCE-INVENTORY.md b/project/SOURCE-INVENTORY.md index c9d804c..7689753 100644 --- a/project/SOURCE-INVENTORY.md +++ b/project/SOURCE-INVENTORY.md @@ -1,6 +1,6 @@ # Source inventory ? all Git-tracked paths -**Snapshot:** 2026-11-22, P05-SEC-01 security source on approved baseline `1a60255`; the new security CI run has not yet been executed. +**Snapshot:** 2026-11-22, P05-SEC-01 source and docs on approved baseline `1a60255`; Gitea Run #87 tested source commit `752d243` (3 PASS / 1 FAIL, 2 Moderate transitive advisories still open). Later documentation-only commit not a new CI test. **Exact Git-tracked paths: 729.** Original upstream source semantics unchanged; untracked `AI_INSTRUCTIONS.md` and ignored local secrets excluded. diff --git a/tests/ci/README.md b/tests/ci/README.md index eadb287..4566134 100644 --- a/tests/ci/README.md +++ b/tests/ci/README.md @@ -14,6 +14,6 @@ No real credentials or production domains are used. Never print bootstrap PATs, - `backend_cleanup.sh` (P05-CI-03) is the workflow's `always()` cleanup script. It tears down only a marked run-owned Compose project and verifies that no project containers, volumes or fixed network remain. Unverified cleanup is an explicit failure. - Run from `.gitea/workflows/p05-backend-acceptance.yml` **only in isolated Gitea CI**, not on a production Docker host or local developer PC. **Run #86 PASS** on `03fb589`, including persistence and owned cleanup. No real user login/MFA E2E was run. -- `security_advisory_gate.py` (P05-SEC-01) takes npm or pnpm registry audit JSON, rejects missing/errored/inconsistent metadata and requires **zero Moderate/High/Critical findings**. It is independent of the existing HIGH+ audit command and `advisory_triage.py` detailed advisory ID report. Do not mark reported Moderate findings resolved without a green CI result. Dedicated `.gitea/workflows/p05-security-acceptance.yml` is manual only; frozen installs/builds run only on Gitea. +- `security_advisory_gate.py` (P05-SEC-01) takes npm or pnpm registry audit JSON, rejects missing/errored/inconsistent metadata and requires **zero Moderate/High/Critical findings**. It is independent of the existing HIGH+ audit command and `advisory_triage.py` detailed advisory ID report. **Gitea Run #87** proved Account audit 0 and Login audit **2 Moderate** (`glob`, `minimatch`); strict Login gate correctly FAILED. Dedicated `.gitea/workflows/p05-security-acceptance.yml` is manual only; frozen installs/builds are CI-only and passed 1219/1219 Login unit regressions. Add new CI checks and update `MINIFEST.md`, `project/`, `docs/`, and `notes/` in the same approved phase.