From c7d32ae22b5c153dd2a372599fe0396fc597c86f Mon Sep 17 00:00:00 2001 From: Md Nurnobi Date: Mon, 23 Nov 2026 11:26:29 +0000 Subject: [PATCH] docs(audit): synchronize production-contract phase status and operator safety guides --- docs/ARCHITECTURE.md | 4 ++++ docs/FEATURES-STATUS.md | 2 ++ docs/PHASES.md | 8 ++++++++ docs/SETUP-GUIDE.md | 6 ++++++ docs/TROUBLESHOOTING.md | 6 ++++++ docs/USER-GUIDE.md | 4 ++++ 6 files changed, 30 insertions(+) diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 2b87936..5bb6e3f 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -28,3 +28,7 @@ ZitPlane is a central **identity and account-management platform**, not a billin ## SaaS applications Each external SaaS authenticates through ZITADEL using OIDC authorization code + PKCE when appropriate and validates tokens on its backend. Each app owns its own billing, subscription, business database, API keys and entitlement enforcement. Key users by stable issuer + subject identity, not email. + +## P05-OIDC-07 — proposed production two-origin trust architecture (not live) + +`https://auth.vib.tools` is the **proposed single ZITADEL OIDC issuer** with TLS 443 edge, exact `/ui/v2/login/**` route to private imported Login V2 port 3000 and remaining OIDC discovery/API/`/ui/console/**` routed via **h2c HTTP/2** to official ZITADEL Go port 8080; neither internal server nor PostgreSQL port 5432 is host published. `https://account.vib.tools` is the **proposed distinct relying-party HTTPS origin**, not a second issuer, with registered `/api/auth/callback/zitadel`; issuer/Host/forwarded headers must be canonical and scrubbed at edge, and production session/cookies tested. Private Login IAM_LOGIN_CLIENT token, separate break-glass IAM_OWNER, 32-byte master-key custody, encrypted PostgreSQL restore and immutable images are mandatory security/recovery design gates. This is **documentation-only**, not validated DNS/TLS or runtime. Detailed source/evidence/next CI-only static dry-run proposal: `notes/P05-OIDC-07.md`, `docs/P05-OIDC-07.md`. diff --git a/docs/FEATURES-STATUS.md b/docs/FEATURES-STATUS.md index b97d16c..c81f093 100644 --- a/docs/FEATURES-STATUS.md +++ b/docs/FEATURES-STATUS.md @@ -61,3 +61,5 @@ Future feature additions need an evidence-backed status update here, an exact de **P05-OIDC-06 terminal (2026-11-23):** [Run #98](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/98) source `fcfa59e826c39b445faa1b5b26c47ce715d8c3d6` **FAILURE**: frozen imported Login source standalone and disposable local custom Docker image **PASS**, OCI entrypoint `/app/entrypoint.sh` **permission denied**, so actual imported Login service/browser OIDC/PKCE/Auth.js/negative/logout **NOT EXECUTED**. Existing backend/OIDC and new image/builder resource cleanup all PASS. Previously accepted original official prebuilt Run #96 real OIDC PASS is intact; no production runtime/HTTPS/MFA accepted. [Exact guide](P05-OIDC-06.md). **P05-OIDC-06-A01 accepted custom source-built Login V2 (2026-11-23):** Actual [Run #99](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/99) job #214 **SUCCESS** on immutable `7d6b6d0704b9e39bcb6e74257dadf0b64a19fc0f`. Git original entrypoint mode `100644` produced disposable copied mode `644`; CI-only temporary copy `755`, actual Docker image default-user executable gate and running custom-image identity PASS. Four services/private issuer and real Chromium **imported custom Login V2** password→PKCE/state/nonce→Auth.js callback/subject/Account protected API/page, anonymous/invalid callback negatives, portal-local logout PASS. Dual exact-owned cleanup PASS. **This verifies custom Login runtime, not production HTTPS/domain, MFA/passkey, Admin Console, federated logout or multi-app SSO.** [Guide](P05-OIDC-06-A01.md). + +**P05-OIDC-07 production readiness status (2026-11-23):** Imported **custom source-built** Login V2 / real Chromium OIDC→Auth.js protected Account/session/negative/logout and dual cleanup **VERIFIED in disposable Run #99** (unchanged). Account `validatedUrl()` production HTTPS-origin guard, PKCE/state/nonce, subject/expiry checks and existing UI/identity API **IMPLEMENTED**. Proposed `auth.vib.tools` single issuer and `account.vib.tools` RP, secure TLS/h2c ingress, trusted headers, registered exact callback/real HTTPS Secure/SameSite cookies, Console cutover, production secret manager/32-byte master-key escrow, backups+isolated restore, SMTP, immutable image release and monitoring **UNVERIFIED / BLOCKED**. MFA/passkey, federated logout and second-app SSO **NOT EXECUTED**. These domain names are hypothetical, and this read-only phase made **no new source/CI/deployment changes**. [Audit](P05-OIDC-07.md). diff --git a/docs/PHASES.md b/docs/PHASES.md index 3c45461..3d6763d 100644 --- a/docs/PHASES.md +++ b/docs/PHASES.md @@ -149,3 +149,11 @@ Approved baseline `b3841d8c05d6b47ceaf1dbc5f7103b8de4f256e6`, accepted [Run #96] - Exactly one [Gitea Run #99](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/99), job #214 **SUCCESS** on `7d6b6d0704b9e39bcb6e74257dadf0b64a19fc0f`, 5/5 job steps SUCCESS. Git imported entrypoint `100644`, disposable standalone copy measured `644` UID:GID `0:0`, copied temp context only repaired `755`; default image-user no-network executable probe PASS, local image build and actual running custom Login ID match PASS. - All 4 disposable services healthy, no published host port, private Host/issuer and Socat PASS. Official project/client/verified test human, real Chromium **source-built imported Login V2** password + OIDC PKCE S256/state/nonce/Auth.js callback, protected Account subject/session/API/pages, anonymous/tampered callback negatives and portal-local logout ALL PASS. Mandatory original backend/OIDC/credentials/DB/network plus new image/builder/temp-context exact-owned cleanup PASS. - No local app build/test, production HTTPS, real accounts, published image, MFA/passkeys, Admin Console interactive test, cross-app SSO, tag or release. [Phase forensic notes](../notes/P05-OIDC-06-A01.md), [operator acceptance guide](P05-OIDC-06-A01.md). Next proposed separate `P05-OIDC-07`: **read-only secure production HTTPS/ingress and secrets/recovery deployment-contract audit**, not a deployment. + +## P05-OIDC-07 — Production HTTPS / Secrets / Recovery Contract Forensic Audit (COMPLETE; docs only, 2026-11-23) + +- Approved and verified baseline `620b165e9d3f2c26ad967db54e540387a076292b`; exact pre-other-doc Scope Lock `notes/P05-OIDC-07.md` committed first at `d5561fa37c6dd5acbda0cbbe74f357fbc490d08d`. +- Existing [Run #99](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/99) Job #214 **SUCCESS** on source `7d6b6d0704b9e39bcb6e74257dadf0b64a19fc0f`: imported source-built custom Login V2 real disposable HTTP localhost Chromium/PKCE/state/nonce/Auth.js session/protected API/negative/logout and both cleanup PASS, unchanged. **No new CI dispatch/run/build/source edit, public DNS/TLS/real user/production inspection or deployment** in P05-OIDC-07. +- **Production-context verdict BLOCKED / NOT VERIFIED:** proposed `https://auth.vib.tools` single issuer and Login/Console, `https://account.vib.tools` relying party exact callback, HTTPS/h2c/forwarded Host and cookies, IAM_LOGIN_CLIENT/break-glass IAM_OWNER/master-key custody, encrypted PostgreSQL recovery, SMTP, digest-pinned images, SBOM/signature/rollback and operations contracts were documented, **not implemented or accepted in production**. Prior P05-OIDC-05 architecture note was superseded only in respect of **custom Login runtime** by Run #99; production findings remain. +- **Write scope** `notes/**`, relevant `project/**`, `docs/**` and necessary README/MINIFEST only; all source/CI/config/infrastructure strictly read-only. Details: [forensic design](../notes/P05-OIDC-07.md), [operator guide](P05-OIDC-07.md). +- **Next proposed separately approved P05-OIDC-08:** new synthetic-only CI dry-run contract files, one manual static/negative test Gitea job, **no production/deploy/real TLS**. Exact whitelist in `notes/P05-OIDC-07.md`. diff --git a/docs/SETUP-GUIDE.md b/docs/SETUP-GUIDE.md index 33dddf6..dcc4e9e 100644 --- a/docs/SETUP-GUIDE.md +++ b/docs/SETUP-GUIDE.md @@ -138,3 +138,9 @@ The imported upstream Login V2 frozen build and temporary local image passed Git The previously failed OCI entrypoint was resolved solely by modifying an ephemeral CI Docker build-context file: original imported `entrypoint.sh` Git `100644`, copy `644`, corrected temp artifact `755`. In [Run #99](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/99), the source-built Login V2 Docker image passed a no-network non-root executable preflight, was started in a portless disposable stack and genuinely authenticated through Chromium/PKCE/Auth.js to the Account Portal. Project/client/human and all secrets/containers/networks/images were deleted after testing. Do **not** modify imported upstream Login source or developer Compose, publish the CI image, deploy dev HTTP localhost to the Internet or reuse the temporary credential/volume bootstrap. HTTPS issuer and domain routing, trusted reverse-proxy Host headers, secure cookies, production secrets/backup/rollback, Admin Console/MFA/SSO remain **unverified**. [Evidence](P05-OIDC-06-A01.md). + +## P05-OIDC-07 — Production design contract only (not installer steps) + +For a later separately approved production rollout, plan **one** HTTPS ZITADEL issuer `https://auth.vib.tools` with `/ui/v2/login/**` to private custom Login and the remaining ZITADEL API/Console to internal HTTP/2 h2c; a separate HTTPS Account origin `https://account.vib.tools` and exact OIDC callback `https://account.vib.tools/api/auth/callback/zitadel`. Both are proposed hostnames, **not live verified DNS/certificates**. Browser cookies, Host/Forwarded headers, proxy IP trust, no public backend ports, Login client credentials, master-key escrow, secure DB backup/restore, SMTP, monitored TLS and rollback require independent acceptance. + +**Do not copy** `deployment/docker/compose.backend.dev.yaml`, its `localhost:8080`, `EXTERNALSECURE=false`, bootstrap first-admin, locally generated `.env`, dev PAT, DB volume or Docker socket mount into production. A protected **32-byte** ZITADEL master key plus matching DB backup must be recoverable; keep Login `IAM_LOGIN_CLIENT` separate from emergency `IAM_OWNER`. Do not automatically switch instance-wide Login V2 before real Console login and break-glass rollback are proven. Current Account `AUTH_TRUST_HOST=true` must be used only behind edge-sanitized forwarded headers. This document is a **design**, not a shell setup guide or deployment. [P05-OIDC-07 operator guide](P05-OIDC-07.md). diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.md index c8fa9fe..fe0bc5b 100644 --- a/docs/TROUBLESHOOTING.md +++ b/docs/TROUBLESHOOTING.md @@ -99,3 +99,9 @@ If production domains do not respond, do not assume Gitea Run #96 deployed them: ## P05-OIDC-06-A01 — entrypoint executable-bit RCA resolved in disposable CI If a previous imported image fails with `exec: "/app/entrypoint.sh": permission denied`, note that Run #98 was a historical failure. Actual Run #99 [evidence](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/99) measured copied standalone mode `644` (Git source `100644`), applied `chmod 0755` **only to the temporary build context** and proved built image `test -x` using no secrets/network and its default non-root user. The actual custom Login service started healthy and full Chromium OIDC/Auth.js/negative/logout PASS. Original source, Dockerfile and production remain unchanged. Never relax PKCE/callback or modify production to resolve a packaging mode. If an unrelated future issue appears, open a new scoped RCA; do not rerun Run #99. [Operator report](P05-OIDC-06-A01.md). + +## P05-OIDC-07 — future production identity troubleshooting boundaries + +If a later public login is broken, **do not** assume [Run #99](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/99) verified HTTPS: it tested custom Login using isolated HTTP localhost. With separately authorized production access, first compare exact external `https://auth.vib.tools` issuer and advertised OIDC discovery (no port/scheme mismatch), registered Account callback, certificate chain, strict Host/Forwarded rewrites and HTTP/2 h2c to API (Console gRPC-Web). Check only **redacted** response status, TLS/cookie flags, Login health and Console session behavior. Never share session cookies, auth codes, bearer tokens, PATs, callback URLs with query values, private keys or unredacted logs. Do not disable PKCE/state/nonce, relax redirect allowlist or set `AUTH_TRUST_HOST` behind an untrusted header path. No live DNS/Coolify/VPS/SSL system was inspected or altered in this phase. + +If master-key or DB recovery is needed, preserve existing key/volumes and use an **approved isolated restore**, not blind key regeneration or unattended production restoration. Login V2 instance-wide cutover may lock out Console; require independent vaulted IAM_OWNER emergency access and planned rollback. Detailed prerequisites and gates: [P05-OIDC-07.md](P05-OIDC-07.md). diff --git a/docs/USER-GUIDE.md b/docs/USER-GUIDE.md index 1868e49..e76f714 100644 --- a/docs/USER-GUIDE.md +++ b/docs/USER-GUIDE.md @@ -89,3 +89,7 @@ Source/CI **verified**: Run #96 successfully authenticated a disposable test hum ## Latest verified custom Login V2 behavior — P05-OIDC-06-A01 In isolated Gitea [Run #99](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/99), the **imported source-built Login V2** itself (not only the original official prebuilt image) completed a genuine disposable username/password Chromium OIDC callback, subject/session and protected Account API/page access, anonymous/callback rejection and portal-local sign-out. This is not a publicly accessible service and cannot establish live behavior for real users, MFA enrollment/passkeys, ZITADEL Console or shared SaaS sessions. Self-service settings still depend on ZITADEL policy. The older original-prebuilt Run #96 also passed independently. Full gate status: [P05-OIDC-06-A01.md](P05-OIDC-06-A01.md). + +## P05-OIDC-07 — important public availability clarification + +The latest [Run #99](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/99) passed genuine **disposable** source-built Login V2 and Account authentication, but **no production/public Account or Login site is verified**. Proposed `auth.vib.tools` and `account.vib.tools` are not confirmed live. The Account Portal's `Sign out of portal` remains local, not all-app/federated logout; `Open central security settings` depends on Console role/policy and was not tested under actual production settings. MFA/passkey enrollment/recovery, real domains/TLS/redirect cookies, public login and multi-app SSO remain future acceptance work. Production security/backup prerequisites: [P05-OIDC-07.md](P05-OIDC-07.md).