Files
Charon/docs/implementation/E2E_SECURITY_ENFORCEMENT_FAILURES_SPEC.md
akanealw eec8c28fb3
Some checks are pending
Go Benchmark / Performance Regression Check (push) Waiting to run
Cerberus Integration / Cerberus Security Stack Integration (push) Waiting to run
Upload Coverage to Codecov / Backend Codecov Upload (push) Waiting to run
Upload Coverage to Codecov / Frontend Codecov Upload (push) Waiting to run
CodeQL - Analyze / CodeQL analysis (go) (push) Waiting to run
CodeQL - Analyze / CodeQL analysis (javascript-typescript) (push) Waiting to run
CrowdSec Integration / CrowdSec Bouncer Integration (push) Waiting to run
Docker Build, Publish & Test / build-and-push (push) Waiting to run
Docker Build, Publish & Test / Security Scan PR Image (push) Blocked by required conditions
Quality Checks / Auth Route Protection Contract (push) Waiting to run
Quality Checks / Codecov Trigger/Comment Parity Guard (push) Waiting to run
Quality Checks / Backend (Go) (push) Waiting to run
Quality Checks / Frontend (React) (push) Waiting to run
Rate Limit integration / Rate Limiting Integration (push) Waiting to run
Security Scan (PR) / Trivy Binary Scan (push) Waiting to run
Supply Chain Verification (PR) / Verify Supply Chain (push) Waiting to run
WAF integration / Coraza WAF Integration (push) Waiting to run
changed perms
2026-04-22 18:19:14 +00:00

5.1 KiB
Executable File
Raw Permalink Blame History

E2E Security Enforcement Failures Remediation Plan (2 Remaining)

Context

  • Branch: feature/beta-release
  • Source: docs/reports/qa_report.md
  • Failures: /api/v1/users setup socket hang up (Security Dashboard navigation), Emergency token baseline blocking (Test 1)

Phase 1 Analyze (Root Cause Mapping)

Failure A: /api/v1/users setup socket hang up (Security Dashboard navigation)

Symptoms

  • apiRequestContext.post socket hang up during test setup user creation in:
    • tests/security/security-dashboard.spec.ts (navigation suite)

Likely Backend Cause

  • Test setup creates an admin user via POST /api/v1/users, which is routed through Cerberus middleware before auth.
  • If ACL is enabled and the test runner IP is not in security.admin_whitelist, Cerberus will block all requests when no active ACLs exist.
  • This block can present as a socket hang up when the proxy closes the connection before Playwright reads the response.

Backend Evidence

Fix Options (Backend)

  1. Ensure ACL cannot block authenticated admin setup calls by moving Cerberus after auth for protected routes (so role can be evaluated).
  2. Add an explicit Cerberus bypass for /api/v1/users setup in test/dev mode when the request has a valid admin session.
  3. Require at least one allow/deny list entry before enabling ACL, and return a clear 4xx error instead of terminating the connection.

Failure B: Emergency token baseline not blocked (Test 1)

Symptoms

  • Expected 403 from /api/v1/security/status, received 200 in:
    • tests/security-enforcement/emergency-token.spec.ts (Test 1)

Likely Backend Cause

  • ACL is enabled via /api/v1/settings, but Cerberus treats the request IP as whitelisted (e.g., 127.0.0.1/32) and skips ACL enforcement.
  • The whitelist is stored in SecurityConfig and can persist from prior tests, causing ACL bypass for authenticated requests even without the emergency token.

Backend Evidence

Fix Options (Backend)

  1. Make ACL bypass conditional on authenticated admin context by applying Cerberus after auth on protected routes.
  2. Clear or override security.admin_whitelist when enabling ACL in test runs where the baseline must be blocked.
  3. Add a dedicated ACL enforcement endpoint or status check that is not exempted by admin whitelist.

Phase 2 Focused Remediation Plan (No Code Changes Yet)

Plan A: Diagnose /api/v1/users socket hang up

  1. Confirm ACL and admin whitelist values immediately before test setup user creation.
  2. Check server logs for Cerberus ACL blocks or upstream connection resets during POST /api/v1/users.
  3. Validate that the request is authenticated and that Cerberus is not terminating the request before auth runs.

Acceptance Criteria

  • POST /api/v1/users consistently returns a 2xx or a structured 4xx, not a socket hang up.

Plan B: Emergency token baseline enforcement

  1. Verify security.admin_whitelist contents before Test 1; ensure the test IP is not whitelisted.
  2. Confirm security.acl.enabled and feature.cerberus.enabled are both true after the setup PATCH.
  3. Re-run the baseline /api/v1/security/status request and verify 403 before applying the emergency token.

Acceptance Criteria

  • Baseline /api/v1/security/status returns 403 when ACL + Cerberus are enabled.
  • Emergency token bypass returns 200 for the same endpoint.

Phase 3 Validation Plan

  1. Re-run Chromium E2E suite.
  2. Verify the two failing tests pass.
  3. Capture updated results and include status evidence in QA report.

Risks & Notes

  • If security.admin_whitelist persists across suites, ACL baseline assertions will be bypassed.
  • If Cerberus runs before auth, ACL cannot distinguish authenticated admin setup calls from unauthenticated setup calls.

Next Steps

Status: SUSPENDED - Supersededby critical production bug (Settings Query ID Leakage) Archive Date: 2026-01-28