From 22adba2a70fe8d5f485783fc0c9b0a649df259f1 Mon Sep 17 00:00:00 2001 From: Sharang Parnerkar <30073382+mighty840@users.noreply.github.com> Date: Fri, 25 Sep 2026 21:12:45 +0200 Subject: [PATCH] docs(design): asks match what dsms already exports and pulls Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p --- docs/design/derive-checks-from-controls.md | 54 ++++++++++++++-------- 1 file changed, 35 insertions(+), 19 deletions(-) diff --git a/docs/design/derive-checks-from-controls.md b/docs/design/derive-checks-from-controls.md index cacaabd..a4ed78e 100644 --- a/docs/design/derive-checks-from-controls.md +++ b/docs/design/derive-checks-from-controls.md @@ -40,7 +40,10 @@ coverage. - The binding between a check and a control is ours alone; dsms never sees it. - The surface keywords are hard-coded in Rust (`controls/surface.rs`) rather than derived from control text. - No new check can come out of a control. -- dsms maps our findings to CRA requirements a second time, by CWE (`cra_finding_mapper.py`, `_CWE_TO_REQ`), next to ours. +- dsms has two ways to take our results: + - it pulls our pre-computed OSCAL verdicts over MCP (`POST /v1/cra/oscal-from-scanner`); + - it also re-maps raw findings by CWE (`/assess-from-scanner`, `cra_finding_mapper.py`, `_CWE_TO_REQ`). + The second can disagree with the first. ## Principles (unchanged) @@ -69,18 +72,29 @@ We use that as the gate: | `it_process`, `process`, `document`, `manual` | dsms (process evidence) | Controls outside our lane stay "not checkable in code" on our side and are evidenced in -dsms. **Ask A1:** export the verification method as an OSCAL prop for master controls -(CRA already has `evidence-type`). +dsms. + +**Already in place:** +- The master-controls export (breakpilot PR #129) contains only `source_code` and `network` controls, grouped by method (2,143 network and 739 source_code), so dsms already applies the gate. +- CRA controls carry `evidence-type`. + +**The gap is ours:** `OscalDocument::to_controls()` flattens the groups and loses the method. We keep it per control (story 1). **Ask A1** is therefore only to keep that grouping stable. ### 2. What each control asks, in terms a check can use A control's statement is written for auditors ("SAST … in der CI/CD-Pipeline"), not for -code. dsms has more: `test_procedure[]` and `requirements[]` on canonical controls, -which its OSCAL import drops and its export does not carry yet. +code. The more concrete material differs by catalog: -**Ask A2:** export them as OSCAL `assessment-objective` parts. +- **CRA (the pilot's 40):** already there. Each control links dsms measures, exported as + 24 back-matter resources, for example M600 "Nicht benötigte Dienste, Ports und + Protokolle standardmäßig deaktivieren". We read those links today but do not use them. + They are the first source. No ask. +- **Master controls:** the canonical controls behind them have `test_procedure[]` and + `requirements[]`, which the export does not carry. **Ask A2:** export them as raw + catalog parts. The OSCAL *assessment objectives* stay on our side, as agreed on + 2026-07-20: catalog content is dsms's, the assessment layer is ours. -We then derive, once per control and version, reviewed by a person: +From that material we derive, once per control and version, reviewed by a person: - **check texts per binding** (today written by hand, #381); - **surface terms per language** for the grounded check (today hard-coded in `surface.rs`), with C/C++, ST/SCL and the web languages as separate lists. @@ -119,33 +133,35 @@ The unused `ControlsProvider::controls()` query API becomes the entry point. ### 5. One mapping, not two -dsms maps our findings to CRA requirements again by CWE (`_CWE_TO_REQ`). Two mappings of -the same finding will drift. Instead: -- Prüfwerk exports, per target, the per-control verdicts and its coverage (which controls it checks, with which tools and for which languages). The `oscal_assessment` and `get_control_mapping` MCP tools already expose most of this. -- **Ask A5:** dsms consumes those verdicts and marks the controls Prüfwerk covers as machine-checked, keeping its CWE table only as a fallback for other scanners. +dsms already pulls our per-control verdicts as OSCAL (`POST /v1/cra/oscal-from-scanner` +calling our `oscal_assessment` MCP tool). But `/assess-from-scanner` still re-maps raw +findings by CWE (`_CWE_TO_REQ`), and two mappings of the same finding will drift. Instead: +- **Ask A5:** for Prüfwerk findings, the OSCAL path is the only one. The CWE table stays as a fallback for other scanners. +- **Coverage:** Prüfwerk adds its per-control coverage (which controls it checks, with which tools, for which languages, and whether the last run completed), so dsms can mark those controls as machine-checked and ask for process evidence only for the rest. `get_control_mapping` already exposes the static part. ## Asks to breakpilot-compliance | # | Ask | Why | | --- | --- | --- | -| A1 | Verification method as an OSCAL prop on the master-controls export | the gate (1) | -| A2 | `test_procedure` / `requirements` as OSCAL `assessment-objective` parts | check texts and surface terms (2), rule candidates (3) | +| A1 | Keep the master-controls export grouped by verification method (as today) | the gate (1) | +| A2 | `test_procedure` / `requirements` of master controls as raw catalog parts (objectives stay ours) | check texts and surface terms (2), rule candidates (3) | | A3 | Keep control ids stable and the content hash per catalog | our map is keyed on them | | A4 | Umlauts in the catalog's titles and prose ("Passwörter", not "Passwoerter") | shown to customers verbatim | -| A5 | Consume Prüfwerk's per-control verdicts and coverage; CWE table only as fallback | one mapping (5) | +| A5 | For Prüfwerk findings, use only the OSCAL verdicts (not `_CWE_TO_REQ`), plus our coverage | one mapping (5) | | A6 | A service token for the master-controls export | #382, retrieval (4) | ## What we build (stories, once agreed) -1. **Gate by method:** read the verification method and evidence type; controls outside our lane are "evidenced in dsms" on the CRA status. -2. **Derived check texts and surface terms:** a reviewed, versioned import of the objectives into the control map; `surface.rs` reads its terms from there. +1. **Gate by method:** keep the method from the export's groups and the CRA evidence type per control; controls outside our lane are "evidenced in dsms" on the CRA status. +2. **Derived check texts and surface terms:** for CRA, from the linked measures (available now); for master controls, from A2's material. Reviewed and versioned in the control map; `surface.rs` reads its terms from there. 3. **Rule-candidate pipeline:** LLM draft, deterministic test gate, review; one candidate per uncovered control; nightly fixture per accepted rule. 4. **Judge answer and pre-filter:** counter-evidence spans and failure mode; deterministic term pre-filter in 5c. 5. **Coverage export:** per-control coverage (tools, languages, last run) over MCP and in the evidence pack. -**Order.** Stories 1 and 5 need only A1 and A5 and give the biggest win: no double -mapping, and an honest split between machine and process evidence. Stories 2 and 3 need -A2. Story 4 needs #382. +**Order.** +- Stories 1 and 5 need nothing new from dsms except A5, and give the biggest win: one mapping, and an honest split between machine and process evidence. +- Story 2 can start now for the 40 CRA controls (from the measures); master controls need A2. +- Story 3 follows story 2. Story 4 needs #382. ## Open questions