MVP-0.7 · Secrets at rest + dashboard session hardening #260

Closed
opened 2026-09-20 20:16:05 +00:00 by sharang · 0 comments
Owner

Goal

Tracker tokens, artifact auth secrets and webhook secrets are stored in plain text and returned from the API, the crypto layer silently falls back to plaintext, and the dashboard session is signed with an ephemeral key over a non-Secure cookie with an open redirect in the login flow.

What to change

  • Encrypt tracker tokens, ArtifactAuth.secret and webhook_secret at rest, and never return them from GET /targets/{id}.
  • Remove the plaintext fallback in crypto.rs:23-26.
  • The dashboard session signing key comes from a secret, and cookies are Secure.
  • Sessions survive a redeploy (Mongo-backed store).
  • Fix the open redirect (infrastructure/auth.rs:85,204-209).
  • Fix or remove the broken webhook proxy (infrastructure/server.rs:122,142-156).

Acceptance

  • No secret field is readable from any API response; a test asserts the redaction on GET /targets/{id}.
  • crypto.rs fails closed when no key is configured instead of storing plaintext.
  • A dashboard redeploy does not log users out.
  • Session cookies are Secure, HttpOnly and SameSite; the signing key is loaded from a secret.
  • The post-login redirect only accepts same-origin paths, with a test for the external-URL case.
  • The webhook proxy either works end to end or is removed.
## Goal Tracker tokens, artifact auth secrets and webhook secrets are stored in plain text and returned from the API, the crypto layer silently falls back to plaintext, and the dashboard session is signed with an ephemeral key over a non-`Secure` cookie with an open redirect in the login flow. ## What to change - Encrypt tracker tokens, `ArtifactAuth.secret` and `webhook_secret` at rest, and never return them from `GET /targets/{id}`. - Remove the plaintext fallback in `crypto.rs:23-26`. - The dashboard session signing key comes from a secret, and cookies are `Secure`. - Sessions survive a redeploy (Mongo-backed store). - Fix the open redirect (`infrastructure/auth.rs:85,204-209`). - Fix or remove the broken webhook proxy (`infrastructure/server.rs:122,142-156`). ## Acceptance - [ ] No secret field is readable from any API response; a test asserts the redaction on `GET /targets/{id}`. - [ ] `crypto.rs` fails closed when no key is configured instead of storing plaintext. - [ ] A dashboard redeploy does not log users out. - [ ] Session cookies are `Secure`, `HttpOnly` and `SameSite`; the signing key is loaded from a secret. - [ ] The post-login redirect only accepts same-origin paths, with a test for the external-URL case. - [ ] The webhook proxy either works end to end or is removed.
sharang added this to the Production MVP milestone 2026-09-20 20:16:05 +00:00
sharang added the securityhigh labels 2026-09-20 20:16:05 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: platform/pruefwerk#260