Files
ZitPlane/notes/P05-OIDC-10.md
T

7.1 KiB

P05-OIDC-10 — CI-Only Imported Login OCI Provenance & Reproducible Build Gate

Date: 2026-11-23 Asia/Dhaka; approved baseline: f06773b39322f14b7bae48850574c1243420e7ec, independently matched Gitea main; starting tracked inventory: 793, full tree not truncated.

EXACT PRE-SOURCE SCOPE LOCK — MUST COMMIT THIS NOTE FIRST

SOURCE WRITE ONLY:

  • NEW tests/ci/login_image/provenance.py — stdlib-only read-only git/input provenance checks, image metadata/SBOM materials, fail-closed mutation negatives;
  • NEW tests/ci/login_image/provenance-lock.json — finite immutable upstream-source and base index digest pins;
  • NARROW existing tests/ci/login_image/build.sh — opt-in provenance mode for pinned builder/runtime base image and temporary Dockerfile ONLY; existing Run #99 default path must remain unchanged;
  • NEW .gitea/workflows/p05-login-provenance.yml — manually dispatched single disposable CI job, owned-only teardown, no registry/production.

ASSOCIATED DOCUMENTATION WRITE: tests/ci/login_image/{README.md,MINIFEST.md}, .gitea/workflows/{README.md,MINIFEST.md}, notes/**, relevant project/**, docs/**, and necessary root README/MINIFEST. All other paths READ ONLY.

STRICT READ-ONLY: auth/** (imported upstream Login source, Dockerfile, entrypoint and lock unchanged), users/**, core/**, all deployment/**, all preexisting .gitea/workflows/*.yml including Run #99 and Run #105 workflows, all other tests/** including tests/ci/login_image/cleanup.sh, all package manifests/lockfiles, runner config, external VPS/Coolify/Cloudflare/DNS/SSL/production infrastructure/secrets, unrelated files and untracked AI_INSTRUCTIONS.md (never inspect or touch).

NO: source vendor modifications, production/live user or secret access, infrastructure deployment, public TLS/DNS, release or tag, registry push, private signing key, protected runner configuration; no local app build/test. Exactly ONE new Gitea manual disposable CI run after one focused source/security/diff audit, no rerun/post-dispatch code edit if failed. CI may pull specifically pinned public base images and temporarily build/run an isolated nonnetwork probe; existing run-owned cleanup must execute with always() after success/failure. No previous accepted workflow CI rerun.

Read-only facts and immutable input references

  • Prior accepted Run #99, Job #214 COMPLETED SUCCESS on 7d6b6d0704b9e39bcb6e74257dadf0b64a19fc0f: original imported custom Login image built in run-owned Node22/bookworm builder, original next standalone, entrypoint copied 644→755 in temporary context, real Chromium OIDC/PKCE/Auth.js acceptance, owned cleanup; temporary image removed. Existing tests/ci/login_image/{build.sh,cleanup.sh} must not alter its prior mode.
  • Accepted Run #105 48/48 synthetic-only security negatives PASS. Neither CI establishes public production release.
  • Gitea Git tree auth/ui/v2 76683086acb5d4ccf3b2094f894e19a8aa0fafa9; pnpm-lock.yaml blob d37471c041f45aad4c1403c628d175b7ca984032; original apps/login/Dockerfile c737bef057035882a0ca959bc641ead6ffb9cc5b with FROM node:24-alpine mutable tag; apps/login/scripts/entrypoint.sh blob 2da2aca45348afeb7480323e02cf98902d479db3 mode 100644; root package.json blob f9a180ba5ee73b126f668537d4695da6dd7c2e70 (pnpm@10.30.3). Imported upstream source revision from auth/ui/v2/README.md: 384bb9ec96b501ad39dc232ee2061a40fe180bbd, tag v4.20.4. This is source-attested import metadata, not independently re-fetched upstream in this phase.
  • External public Docker Hub metadata read-only on 2026-11-23: library/node:22-bookworm OCI index digest sha256:e13726ca604184d7a91fcacab1fc09eefd642dc28e79ac34e85540dd93b78cfb (linux/amd64 child sha256:69c6e263db01e9946c7743bbbe9f7b1ba0df384d27ec09e08e5832d6acd3daf3); library/node:24-alpine OCI index digest sha256:116b800c3754b440ee0aa3ed2f20f5bf3d99a554bfd9adeea09ea8017f6e85f5 (amd64 child sha256:d8d97e479cdc64f052f81f129362168717c59783ade8dcc1abd22e1cca8dbd7c). These are manifest-index identities observed externally, not Gitea Docker runtime confirmations, and must be fetched/checked by the newly approved disposable CI. Pin linux/amd64; fail closed if architecture, digest or runtime contents disagree.

Implementation and acceptance plan

  1. Add a strict normalized JSON lock whose exact keys pin source tree/blob, public OCI index+amd64 child identity, platform, package manager, upstream tag/revision. Fail on substituted/unknown inputs or mismatched Git tree/lock/Dockerfile blobs; record exact source checkout SHA in attestation. New workflow runner itself uses a pinned, public node:24-alpine index (no secret access), builder uses node:22-bookworm@sha256:....
  2. Existing build.sh must remain unchanged in default Run #99 mode. Under ZITPLANE_PROVENANCE_CI=1 only: verify preflight and digests; pull/create pinned builder, pinned temporary Dockerfile FROM node:24-alpine@sha256:... without editing original Dockerfile, build frozen workspace pnpm@10.30.3, emit no credential values, temporary entrypoint 0755 only, check built image ID/platform/nonroot/labels/entrypoint, generate source/base/dependency-material SPDX-lite SBOM and sanitized JSON attestation inside run-owned temporary build context (no upload or publish). Explicitly label SBOM metadata is partial material inventory, NOT comprehensive package/OS SCA; later release requires full scanner and signed artifacts.
  3. Focused negative fixture scenarios: altered source SHA/lock blob/base digest, unexpected Dockerfile bytes, wrong platform and unauthorized image attributes or invalid grant of build credentials (all local in-memory fail closed). Ensure stage markers and final job status contain no tokens/env dumps.
  4. New workflow workflow_dispatch only, read-only contents permission, one job, no production secrets/registry credentials, one disposable build plus a nonnetwork nonroot probe, same run-owned cleanup.sh inside always(), safe exact cleanup verification and no background/image retention. No real browser/OIDC rerun or production runtime; Run #99 remains separate accepted evidence.
  5. Before CI: ONE focused source/security/exact-diff audit. Commit/push tested source SHA, dispatch ONE newly approved manual run. Verify frozen lock build, immutable source/index identities, nonroot/entrypoint, SPDX-lite materials/attestation and fail-closed negatives, known cleanup. If CI fails, record FAIL/NOT EXECUTED, no repeat or source patch.
  6. Synchronize notes/project/docs, source inventory, workflow/image helper README/MINIFEST, final cumulative scope/security audit, docs commit/push and exact remote HEAD SHA. Distinguish CI source SHA from documentation-closure SHA.

P05-OIDC-10 does NOT certify production deployment, signed registry image, public DNS/TLS, master key/backup, Console/MFA/passkeys or multi-app SSO. Next independent Account OCI/production security work requires a new approval.

Initial status: this note must be committed FIRST. No source edit/new CI run yet.