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
Owner

Closes #283. Pilot P2, item L. Stacked on the MCP PR.

What

  • Every control of the CRA map gets exactly one state:
    • not satisfied: open findings reference it. False positives and resolved findings don't count; an accepted risk does.
    • no violation found: checkable in code, a scan has completed, and nothing is against it.
    • not assessed: no completed scan yet, or no tool checks it (NeedsTooling). Nothing counts as passed before a scan.
    • not code-checkable: a design property, labelled as the breakpilot compliance process's lane rather than shown as a failure.
  • GET /api/v1/targets/{id}/compliance:
    • the controls with the findings against each (title, severity, status, file:line);
    • counts per state;
    • the last scan;
    • SBOM and CVE counts.
  • Evidence pack: gains cra-compliance.json with the same states.
  • Dashboard /targets/{id}/compliance ("CRA-Status"):
    • stat cards;
    • violated controls first, each finding linked to its detail page;
    • the map's note on each non-checkable control;
    • evidence-pack download;
    • reachable from each target's details. German and English.

Not in this PR

  • The VEX summary: nothing imports OpenVEX yet (MVP-2.6).
  • PLC findings get refs only where the map binds their rule ids (MVP-2.7).

Verification

  • Unit tests: one state per control; open vs closed findings; nothing passes before a scan; page sort order.
  • The evidence integration test (MongoDB) checks the endpoint:
    • all 40 controls listed;
    • cra-ai-8 not satisfied, with the pentest finding's location;
    • 0 "no violation" on a never-scanned target;
    • 19 not code-checkable.
  • clippy with the CI flags; fmt; tests.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p

Closes #283. Pilot P2, item L. **Stacked on the MCP PR.** ## What - **Every control of the CRA map gets exactly one state:** - **not satisfied**: open findings reference it. False positives and resolved findings don't count; an accepted risk does. - **no violation found**: checkable in code, a scan has completed, and nothing is against it. - **not assessed**: no completed scan yet, or no tool checks it (`NeedsTooling`). Nothing counts as passed before a scan. - **not code-checkable**: a design property, labelled as the breakpilot compliance process's lane rather than shown as a failure. - **`GET /api/v1/targets/{id}/compliance`:** - the controls with the findings against each (title, severity, status, file:line); - counts per state; - the last scan; - SBOM and CVE counts. - **Evidence pack:** gains `cra-compliance.json` with the same states. - **Dashboard `/targets/{id}/compliance` ("CRA-Status"):** - stat cards; - violated controls first, each finding linked to its detail page; - the map's note on each non-checkable control; - evidence-pack download; - reachable from each target's details. German and English. ## Not in this PR - The VEX summary: nothing imports OpenVEX yet (MVP-2.6). - PLC findings get refs only where the map binds their rule ids (MVP-2.7). ## Verification - Unit tests: one state per control; open vs closed findings; nothing passes before a scan; page sort order. - The evidence integration test (MongoDB) checks the endpoint: - all 40 controls listed; - `cra-ai-8` not satisfied, with the pentest finding's location; - 0 "no violation" on a never-scanned target; - 19 not code-checkable. - clippy with the CI flags; fmt; tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang changed target branch from feat/mcp-contract-tools to main 2026-09-23 15:54:44 +00:00
sharang added 1 commit 2026-09-23 15:54:44 +00:00
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
51572206c0
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
sharang force-pushed feat/compliance-view from 7d8be899a3 to 51572206c0 2026-09-23 15:54:46 +00:00 Compare
sharang merged commit 0249aee44a into main 2026-09-23 16:03:24 +00:00
Sign in to join this conversation.