Drafted the task markdown file for Phase 4 covering Central SSO Application Launchpad, Logout Return-Path Preservation, Hybrid Ingress Gateway Protocol, and Strict Additive Security Audit. Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
5.6 KiB
5.6 KiB
TASK METADATA
- Target Files:
ui/mod.ts,ui/components/AppLaunchpadPage.tsx,ui/components/AuthenticatedLayout.tsx,server/main.test.ts,docs/HYBRID_INGRESS_PLAYBOOK.md - Core Objective: Architect and formalize the specification and implementation plan for Universal Logout Return-Path Preservation, Central SSO Application Launchpad, Hybrid Ingress Routing Playbook, and Strict Additive Security Audit.
- Dependencies: Existing UI layout system,
docs/FORWARDAUTH_REDIRECT_SPEC.md,server/auth-session.ts, Merkle Tree Audit Ledger. - Additional Important Notes: Must adhere strictly to Zero-Trust invisibility for ungranted apps. Must maintain 100% test coverage and ensure zero regressions across WebAuthn, SSS, and RFC 9421.
2. Architectural Considerations & Risks
Before detailing implementation steps, the following risks and constraints must be strictly adhered to:
-
Risks:
- Open-Redirect Vulnerability (CWE-601): The
/logout?redirect=endpoint is a prime target for phishing if not strictly validated against an approved whitelist. - RBAC Data Leakage: Exposing ungranted applications, even visually disabled, leaks internal network topology and service architecture.
- Regression of Cryptographic Core: Modifying session lifecycle hooks (like logout) must not break the Merkle Tree Audit Ledger, WebAuthn PRF flows, or Edge Signatures.
- Open-Redirect Vulnerability (CWE-601): The
-
Alternatives & Architecture Decisions:
- Redirect Validation: We will strictly implement the
isSafeRedirectUrllogic defined indocs/FORWARDAUTH_REDIRECT_SPEC.md(*.atyg.org,localhost, relative paths) for both login and logout flows. - Zero-Knowledge Launchpad: Regular users will only see applications they
have explicit grants for. Global Admins (
isGlobalAdmin = true) will see all fleet applications. - Cryptographic Auditing: Explicit audit events (
logout_success,open_redirect_intercepted) will be injected directly into the RFC 6962 Merkle tree upon logout operations.
- Redirect Validation: We will strictly implement the
3. Proposed Implementation
The implementation must be executed in the following strict phases:
Phase 1: Logout Return-Path Preservation (GET /logout)
- Update
ui/mod.ts:- Extract the
redirectquery parameter in theGET /logouthandler. - Implement strict whitelist validation (
isSafeRedirectUrl):- Must allow relative paths (
/). - Must allow explicit wildcard
*.atyg.orgorlocalhost.
- Must allow relative paths (
- Audit Integration:
- If validation fails, immediately log an
open_redirect_interceptedevent to the Merkle Audit Ledger (including client IP, original requested URL, and blocked destination), then discard the parameter. - Upon successful session destruction (cache + DB wipe), log a
logout_successaudit event.
- If validation fails, immediately log an
- Redirect the user to
/login?redirect=${encodeURIComponent(safeRedirect)}(if a safe redirect exists), otherwise fallback to/login.
- Extract the
Phase 2: Central SSO Application Launchpad (App Switcher)
- Create
ui/components/AppLaunchpadPage.tsx:- Build a pure Hono SSR JSX component rendering interactive application cards.
- Each card must display the app name, description, role indicator (e.g.,
Admin,Operator), and a 1-click launch link.
- Update Route
GET /dashboardinui/mod.ts:- Change the default
/dashboardredirect to renderAppLaunchpadPage. - Update navigation in
ui/components/AuthenticatedLayout.tsxto include the new Launchpad as the primary dashboard view.
- Change the default
- Zero-Trust Query Logic:
- Fetch the authenticated user and their
isGlobalAdminstatus. - Regular Users: Query
grantsJOINappsto fetch strictly only the applications they possess an active grant for. - Global Admins: Query
appsto fetch all applications, annotating them with an[Admin]badge and providing a direct link to the IAM Management Console.
- Fetch the authenticated user and their
Phase 3: Hybrid Ingress Routing Pattern & Playbook
- Document
docs/HYBRID_INGRESS_PLAYBOOK.md:- Provide concrete reference configurations for consumer web applications requiring hybrid public splash views alongside protected private cockpits.
- Detail the dual-routing pattern: Traefik edge ForwardAuth protection for
/control-panel,/ws,/api/*+ App/SDK-level SSR hydration on the root/.
Phase 4: Strict Additive Security & Regression Audit
- Test Coverage Additions (
server/main.test.ts):- Write tests validating the open-redirect whitelist logic in
/logout. - Write tests verifying Zero-Knowledge visibility of the Launchpad (users see only granted apps, admins see all).
- Write tests verifying the new audit log events (
logout_success,open_redirect_intercepted) are correctly appended.
- Write tests validating the open-redirect whitelist logic in
- Pre/Post Hermetic Test Mandate:
- All 42+ existing unit tests in
server/*.test.tsandsdk/*.test.tsMUST pass hermetically before and after modifications.
- All 42+ existing unit tests in
- End-to-End QA Checklist (To be included in Completion Report):
- Verify WebAuthn PRF extension negotiation (
/api/login/challenge&/api/register/verify). - Verify 2-of-3 SSS Wasm memory zeroization and key reconstruction (Scenario A & Scenario B).
- Verify RFC 9421 Ed25519 signature verification against the O(1) Valkey fingerprint set.
- Verify WebAuthn PRF extension negotiation (
- Coverage Validation Requirement:
- Run the following command before final submission:
deno test -A --unstable-ffi --coverage=cov_profile && deno coverage cov_profile - Include the generated coverage table in the PR description / final completion summary.
- Run the following command before final submission: