Fail closed when dashboard authentication is not explicitly configured #262

Closed
opened 2026-08-08 04:29:40 +00:00 by timmy · 0 comments
Owner

Problem

The operator-session boundary currently bypasses authentication when STACKCHAIN_DASHBOARD_ACCESS_TOKEN is absent, and derives the signing key from that token when STACKCHAIN_DASHBOARD_SESSION_SECRET is absent. A deployment typo can therefore expose privileged Gitea-backed APIs anonymously. Historical issue/PR review through #261 found only #258/#259 (optional operator sessions), not fail-closed configuration.

Product slice

Introduce explicit authentication modes: secure operator by default and an intentional loopback-only insecure-local development mode. Operator mode requires independent access and session secrets; invalid or incomplete configuration leaves liveness available but blocks readiness, login, dashboard, and APIs without contacting Gitea. Remove signing-secret derivation.

Acceptance criteria

  • /healthz remains 200 with invalid auth configuration.
  • /readyz, /login, /, and private APIs return sanitized 503 without calling Gitea when operator secrets are missing/invalid.
  • Operator mode requires independent access/session secrets and preserves current secure session/CSRF behavior.
  • insecure-local works only for loopback clients and rejects non-loopback requests.
  • Existing session and full regression suites pass; README documents migration and local mode.
## Problem The operator-session boundary currently bypasses authentication when `STACKCHAIN_DASHBOARD_ACCESS_TOKEN` is absent, and derives the signing key from that token when `STACKCHAIN_DASHBOARD_SESSION_SECRET` is absent. A deployment typo can therefore expose privileged Gitea-backed APIs anonymously. Historical issue/PR review through #261 found only #258/#259 (optional operator sessions), not fail-closed configuration. ## Product slice Introduce explicit authentication modes: secure `operator` by default and an intentional loopback-only `insecure-local` development mode. Operator mode requires independent access and session secrets; invalid or incomplete configuration leaves liveness available but blocks readiness, login, dashboard, and APIs without contacting Gitea. Remove signing-secret derivation. ## Acceptance criteria - `/healthz` remains 200 with invalid auth configuration. - `/readyz`, `/login`, `/`, and private APIs return sanitized 503 without calling Gitea when operator secrets are missing/invalid. - Operator mode requires independent access/session secrets and preserves current secure session/CSRF behavior. - `insecure-local` works only for loopback clients and rejects non-loopback requests. - Existing session and full regression suites pass; README documents migration and local mode.
timmy self-assigned this 2026-08-08 04:29:40 +00:00
timmy closed this issue 2026-08-08 04:33:26 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: stackchain/stackchain-dashboard#262
No description provided.