feat(compliance): per-target CRA Annex I status (#283) #354

Merged
sharang merged 1 commits from feat/compliance-view into main 2026-09-23 16:03:24 +00:00
1 Commits
Author SHA1 Message Date
Sharang ParnerkarandClaude Opus 5.5 51572206c0 feat(compliance): per-target CRA Annex I status (#283)
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) Successful in 8m33s
A customer needs one page per target that answers "where do we stand
against the CRA Annex I requirements, and on what evidence?".

- Every control of the CRA map gets exactly one state:
  not satisfied (open findings reference it; false positives and resolved
  findings do not count, an accepted risk does), no violation found
  (checkable in code, scanned, nothing against it), not assessed (no
  completed scan yet, or no tool checks it), or not checkable in code (a
  design property for the breakpilot compliance process).
- GET /api/v1/targets/{id}/compliance: the controls with the findings
  against each (file:line, status), counts per state, the last scan, SBOM
  and CVE counts. The evidence pack gains cra-compliance.json with the
  same states.
- Dashboard: /targets/{id}/compliance ("CRA-Status"), violated controls
  first, each finding linked; reachable from the target's details.

Tests: one state per control, open vs closed findings, nothing passes
before a scan, sort order; the evidence integration test (MongoDB) checks
40 controls, the violated one with its location, 19 not code-checkable.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
2026-09-23 17:54:42 +02:00