CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Canceled after 6m28s
Git tokens, tracker tokens, webhook secrets and pentest passwords were stored
in plain text and returned by the API. The old crypto helper fell back to
plain text when no key was set.
- `secrets::SecretBox`: AES-256-GCM under `SECRETS_ENCRYPTION_KEY`, with sealed
values stored as `enc:v1:…`. With no key it refuses to seal instead of
storing plain text. The key is required when APP_ENV is hardened, and a
malformed key stops startup in every environment. It replaces
`pentest/crypto.rs`.
- `compliance_core::models::Credentials` lists each record's credential fields
once. The agent seals them before a write and redacts them from every target,
DAST target and pentest-session response, including the MCP pentest tools.
- `PATCH /targets/{id}`: a credential left out keeps its stored value, an
empty string clears it, and a new one is sealed. A client echoing a redacted
record back therefore cannot erase a token.
- Pentest sessions are sealed before the first insert. Previously they were
inserted in plain text and encrypted afterwards.
- On startup the agent seals credentials that were stored in plain text.
- Webhook receivers fail closed: a target without a usable secret gets 401
instead of unsigned acceptance. GitLab tokens are compared in constant time.
New targets no longer get a webhook secret at creation; issuing one comes
back with the webhook work.
Part 1 of #260 (agent). Dashboard session hardening, the open redirect and
the webhook proxy follow in a separate PR.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p