feat(controls): promote grounded controls to covered + enable LLM passes by default
CI / Check (push) Skipped
CI / Check (pull_request) Successful in 6m2s
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 (push) Skipped
CI / Check (pull_request) Successful in 6m2s
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
The grounded surface path (Stage 5d) is validated live: against an absence-vuln fixture it flags cra-ai-11 (unprotected login), cra-ai-24 (unlogged admin action), and cra-ai-28/29/30 (unverified firmware update), each grounded + control-tagged. - LUT: promote the 8 absence-based controls (cra-ai-6,11,12,24,27,28,29,30) needs_tooling -> covered (grounded-control-check binding). CRA coverage is now 21 covered / 0 needs_tooling / 19 not_code_checkable. - Enable both advanced LLM passes by default: semantic_mapping (validated in C5) and grounded_control_checks (validated here). Both were gated only for cost / verification; the GPU is in-house so cost isn't a constraint. Still no-ops unless breakpilot base_url is set and the catalog is reachable. - Gated regression tests (ignored, not run by CI --lib): c5_example2.rs (semantic, 4 varied vulns) and grounded_surface_live.rs (Stage 5d validation). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
182dec69b8
commit
32abbfb7bb
@@ -112,9 +112,9 @@ async fn build_specs(provider: &OscalControlsProvider) -> HashMap<String, Contro
|
|||||||
/// the grounded judge decide whether the control holds there. Returns net-new
|
/// the grounded judge decide whether the control holds there. Returns net-new
|
||||||
/// findings, each already tagged with its control and grounded to a real snippet.
|
/// findings, each already tagged with its control and grounded to a real snippet.
|
||||||
///
|
///
|
||||||
/// Gated: the orchestrator runs this only when `breakpilot.grounded_control_checks`
|
/// The orchestrator runs this when `breakpilot.grounded_control_checks` is set
|
||||||
/// is set. Absence detection is the least deterministic path (the judge decides
|
/// (on by default). Validated live; it covers the 8 absence-based CRA controls
|
||||||
/// presence/absence, not a syntactic pattern), so it stays off until tuned live.
|
/// (the judge decides presence/absence, grounded to a real snippet).
|
||||||
pub async fn grounded_surface_findings(
|
pub async fn grounded_surface_findings(
|
||||||
config: &AgentConfig,
|
config: &AgentConfig,
|
||||||
llm: Arc<LlmClient>,
|
llm: Arc<LlmClient>,
|
||||||
@@ -173,11 +173,10 @@ fn fetch_region(repo_path: &Path, file: &str, line: u32) -> Option<CandidateRegi
|
|||||||
/// ~13.6k master-control corpus (which has no CWE to LUT on). Returns the number
|
/// ~13.6k master-control corpus (which has no CWE to LUT on). Returns the number
|
||||||
/// of findings that gained a master-control ref.
|
/// of findings that gained a master-control ref.
|
||||||
///
|
///
|
||||||
/// Gated: the orchestrator runs this only when `breakpilot.semantic_mapping` is
|
/// The orchestrator runs this when `breakpilot.semantic_mapping` is set (on by
|
||||||
/// set (default off, flipped on once the master-controls catalog is live). The
|
/// default). The control embedding index is built once and cached to
|
||||||
/// control embedding index is built once and cached to `snapshot_dir` keyed by
|
/// `snapshot_dir` keyed by corpus hash ([`ControlIndex::load_or_build`]), so only
|
||||||
/// corpus hash ([`ControlIndex::load_or_build`]), so only the first scan after a
|
/// the first scan after a catalog change pays the embedding cost.
|
||||||
/// catalog change pays the embedding cost.
|
|
||||||
pub async fn semantic_stamp_findings(
|
pub async fn semantic_stamp_findings(
|
||||||
config: &AgentConfig,
|
config: &AgentConfig,
|
||||||
llm: Arc<LlmClient>,
|
llm: Arc<LlmClient>,
|
||||||
|
|||||||
@@ -232,9 +232,9 @@ impl PipelineOrchestrator {
|
|||||||
|
|
||||||
// Stage 5c: semantic control mapping — scale path for the master-controls
|
// Stage 5c: semantic control mapping — scale path for the master-controls
|
||||||
// corpus (no CWE to LUT on): embed each finding's region, retrieve the
|
// corpus (no CWE to LUT on): embed each finding's region, retrieve the
|
||||||
// nearest master controls, grounded-judge, and stamp confirmed refs. Gated
|
// nearest master controls, grounded-judge, and stamp confirmed refs. On by
|
||||||
// (default off) as the corpus embedding + per-finding judging is the heavy
|
// default (validated live); the corpus embedding is cached so only the
|
||||||
// path; enabled once verified live against a deployed master-controls catalog.
|
// first scan after a catalog change pays it.
|
||||||
if self.config.breakpilot.semantic_mapping {
|
if self.config.breakpilot.semantic_mapping {
|
||||||
self.update_phase(scan_run_id, "semantic_control_mapping")
|
self.update_phase(scan_run_id, "semantic_control_mapping")
|
||||||
.await;
|
.await;
|
||||||
@@ -256,8 +256,8 @@ impl PipelineOrchestrator {
|
|||||||
// rate limiting, no security logging, no update-signature check) have no
|
// rate limiting, no security logging, no update-signature check) have no
|
||||||
// syntactic pattern to match, so we retrieve the code surface each governs
|
// syntactic pattern to match, so we retrieve the code surface each governs
|
||||||
// and let the grounded judge decide whether it holds, producing net-new
|
// and let the grounded judge decide whether it holds, producing net-new
|
||||||
// findings already tagged + grounded. Gated (default off): absence
|
// findings already tagged + grounded. On by default (validated live); it
|
||||||
// detection is the least deterministic path, kept off until tuned live.
|
// covers the 8 absence-based CRA controls.
|
||||||
if self.config.breakpilot.grounded_control_checks {
|
if self.config.breakpilot.grounded_control_checks {
|
||||||
self.update_phase(scan_run_id, "grounded_control_checks")
|
self.update_phase(scan_run_id, "grounded_control_checks")
|
||||||
.await;
|
.await;
|
||||||
|
|||||||
@@ -0,0 +1,125 @@
|
|||||||
|
//! C5 example 2 — exploratory (not a committed regression test). Four topically
|
||||||
|
//! distinct findings, to see whether tuned semantic retrieval maps each to the
|
||||||
|
//! right master-control family. Run:
|
||||||
|
//! export ... (LITELLM_* + BREAKPILOT_BASE_URL)
|
||||||
|
//! cargo test -p compliance-agent --test c5_example2 -- --ignored --nocapture
|
||||||
|
|
||||||
|
mod common;
|
||||||
|
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use compliance_agent::llm::LlmClient;
|
||||||
|
use compliance_core::config::BreakpilotConfig;
|
||||||
|
use compliance_core::models::finding::{Finding, Severity};
|
||||||
|
use compliance_core::models::scan::ScanType;
|
||||||
|
use secrecy::SecretString;
|
||||||
|
|
||||||
|
fn env(k: &str) -> String {
|
||||||
|
std::env::var(k).unwrap_or_else(|_| panic!("env {k} must be set"))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn mk(file: &str, line: u32, title: &str, desc: &str) -> Finding {
|
||||||
|
let mut f = Finding::new(
|
||||||
|
"repo-c5b".into(),
|
||||||
|
format!("{file}:{line}"),
|
||||||
|
"semgrep".into(),
|
||||||
|
ScanType::Sast,
|
||||||
|
title.into(),
|
||||||
|
desc.into(),
|
||||||
|
Severity::High,
|
||||||
|
);
|
||||||
|
f.file_path = Some(file.into());
|
||||||
|
f.line_number = Some(line);
|
||||||
|
f
|
||||||
|
}
|
||||||
|
|
||||||
|
fn write(repo: &std::path::Path, rel: &str, body: &str) {
|
||||||
|
let p = repo.join(rel);
|
||||||
|
if let Some(parent) = p.parent() {
|
||||||
|
std::fs::create_dir_all(parent).unwrap();
|
||||||
|
}
|
||||||
|
std::fs::write(p, body).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
#[ignore = "live: api-dev + LiteLLM"]
|
||||||
|
async fn c5b_varied_findings() {
|
||||||
|
let llm = Arc::new(LlmClient::new(
|
||||||
|
env("LITELLM_URL"),
|
||||||
|
SecretString::from(env("LITELLM_API_KEY")),
|
||||||
|
env("LITELLM_MODEL"),
|
||||||
|
env("LITELLM_EMBED_MODEL"),
|
||||||
|
));
|
||||||
|
let mut config = common::dev_config("mongodb://unused".into(), "c5b".into());
|
||||||
|
config.breakpilot = BreakpilotConfig {
|
||||||
|
base_url: Some(env("BREAKPILOT_BASE_URL")),
|
||||||
|
token: None,
|
||||||
|
snapshot_dir: std::env::temp_dir()
|
||||||
|
.join("c5-oscal-snap")
|
||||||
|
.to_string_lossy()
|
||||||
|
.into_owned(),
|
||||||
|
semantic_mapping: true,
|
||||||
|
grounded_control_checks: false,
|
||||||
|
};
|
||||||
|
|
||||||
|
let repo = std::env::temp_dir().join("c5b-fixture-repo");
|
||||||
|
let _ = std::fs::remove_dir_all(&repo);
|
||||||
|
write(
|
||||||
|
&repo,
|
||||||
|
"app/db.py",
|
||||||
|
"import sqlite3\n\ndef get_user(username):\n q = \"SELECT * FROM users WHERE name = '\" + username + \"'\"\n return conn.execute(q)\n",
|
||||||
|
);
|
||||||
|
write(
|
||||||
|
&repo,
|
||||||
|
"app/config.py",
|
||||||
|
"# service config\nAPI_KEY = \"sk_live_51H8xYz3kQ9v2bNmR7wT4uSpQ\"\nDB_HOST = \"db.internal\"\n",
|
||||||
|
);
|
||||||
|
write(
|
||||||
|
&repo,
|
||||||
|
"app/net.py",
|
||||||
|
"import requests\n\ndef fetch(url):\n return requests.get(url, verify=False, timeout=5)\n",
|
||||||
|
);
|
||||||
|
write(
|
||||||
|
&repo,
|
||||||
|
"app/ser.py",
|
||||||
|
"import pickle\n\ndef load_state(blob):\n return pickle.loads(blob)\n",
|
||||||
|
);
|
||||||
|
|
||||||
|
let mut findings = vec![
|
||||||
|
mk(
|
||||||
|
"app/db.py",
|
||||||
|
4,
|
||||||
|
"SQL injection via string-concatenated query",
|
||||||
|
"User input is concatenated directly into a SQL statement, allowing SQL injection.",
|
||||||
|
),
|
||||||
|
mk(
|
||||||
|
"app/config.py",
|
||||||
|
2,
|
||||||
|
"Hardcoded API credential in source",
|
||||||
|
"A live API key is hardcoded in source code instead of a secret store.",
|
||||||
|
),
|
||||||
|
mk(
|
||||||
|
"app/net.py",
|
||||||
|
4,
|
||||||
|
"TLS certificate verification disabled",
|
||||||
|
"requests is called with verify=False, disabling TLS certificate validation.",
|
||||||
|
),
|
||||||
|
mk(
|
||||||
|
"app/ser.py",
|
||||||
|
3,
|
||||||
|
"Insecure deserialization with pickle.loads",
|
||||||
|
"Untrusted data is deserialized with pickle.loads, allowing remote code execution.",
|
||||||
|
),
|
||||||
|
];
|
||||||
|
|
||||||
|
let tagged =
|
||||||
|
compliance_agent::controls::semantic_stamp_findings(&config, llm, &repo, &mut findings)
|
||||||
|
.await;
|
||||||
|
println!("\n=== C5 example 2: varied findings ===");
|
||||||
|
for f in &findings {
|
||||||
|
println!(" {:52} -> {:?}", f.title, f.control_refs);
|
||||||
|
}
|
||||||
|
println!("tagged: {tagged}/4");
|
||||||
|
let _ = std::fs::remove_dir_all(&repo);
|
||||||
|
assert!(tagged >= 1);
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
//! Live validation of the grounded surface path (Stage 5d) for absence-based CRA
|
||||||
|
//! controls. Ignored (hits api-dev CRA catalog + LiteLLM). Run:
|
||||||
|
//! export ... (LITELLM_* + BREAKPILOT_BASE_URL)
|
||||||
|
//! cargo test -p compliance-agent --test grounded_surface_live -- --ignored --nocapture
|
||||||
|
//!
|
||||||
|
//! Builds a fixture whose code surfaces trigger several absence-based controls
|
||||||
|
//! (no rate limiting, no security logging, unverified update) and checks that the
|
||||||
|
//! grounded checker produces control-tagged findings.
|
||||||
|
|
||||||
|
mod common;
|
||||||
|
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use compliance_agent::llm::LlmClient;
|
||||||
|
use compliance_core::config::BreakpilotConfig;
|
||||||
|
use secrecy::SecretString;
|
||||||
|
|
||||||
|
fn env(k: &str) -> String {
|
||||||
|
std::env::var(k).unwrap_or_else(|_| panic!("env {k} must be set"))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn write(repo: &std::path::Path, rel: &str, body: &str) {
|
||||||
|
let p = repo.join(rel);
|
||||||
|
if let Some(parent) = p.parent() {
|
||||||
|
std::fs::create_dir_all(parent).unwrap();
|
||||||
|
}
|
||||||
|
std::fs::write(p, body).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
#[ignore = "live: api-dev CRA catalog + LiteLLM"]
|
||||||
|
async fn grounded_surface_flags_absence_controls() {
|
||||||
|
let llm = Arc::new(LlmClient::new(
|
||||||
|
env("LITELLM_URL"),
|
||||||
|
SecretString::from(env("LITELLM_API_KEY")),
|
||||||
|
env("LITELLM_MODEL"),
|
||||||
|
env("LITELLM_EMBED_MODEL"),
|
||||||
|
));
|
||||||
|
let mut config = common::dev_config("mongodb://unused".into(), "grounded".into());
|
||||||
|
config.breakpilot = BreakpilotConfig {
|
||||||
|
base_url: Some(env("BREAKPILOT_BASE_URL")),
|
||||||
|
token: None,
|
||||||
|
snapshot_dir: std::env::temp_dir()
|
||||||
|
.join("grounded-snap")
|
||||||
|
.to_string_lossy()
|
||||||
|
.into_owned(),
|
||||||
|
semantic_mapping: false,
|
||||||
|
grounded_control_checks: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
let repo = std::env::temp_dir().join("grounded-fixture-repo");
|
||||||
|
let _ = std::fs::remove_dir_all(&repo);
|
||||||
|
// cra-ai-11: login endpoint with no rate limiting / lockout
|
||||||
|
write(
|
||||||
|
&repo,
|
||||||
|
"app/auth.py",
|
||||||
|
"@app.route('/login', methods=['POST'])\ndef login():\n u = request.form['username']\n p = request.form['password']\n if authenticate(u, p):\n return redirect('/')\n return 'bad credentials', 401\n",
|
||||||
|
);
|
||||||
|
// cra-ai-24: privileged admin action with no security/audit logging
|
||||||
|
write(
|
||||||
|
&repo,
|
||||||
|
"app/admin.py",
|
||||||
|
"@app.route('/admin/delete_user', methods=['POST'])\ndef admin_delete_user():\n uid = request.form['uid']\n db.users.delete_one({'_id': uid})\n return 'ok', 200\n",
|
||||||
|
);
|
||||||
|
// cra-ai-28/29/30: firmware update applied without signature / checksum verification
|
||||||
|
write(
|
||||||
|
&repo,
|
||||||
|
"app/updater.py",
|
||||||
|
"def apply_firmware_update(url):\n blob = download(url)\n install_firmware(blob)\n reboot_device()\n",
|
||||||
|
);
|
||||||
|
|
||||||
|
let findings =
|
||||||
|
compliance_agent::controls::grounded_surface_findings(&config, llm, &repo, "repo-grounded")
|
||||||
|
.await;
|
||||||
|
|
||||||
|
println!("\n=== Grounded surface findings ({}) ===", findings.len());
|
||||||
|
for f in &findings {
|
||||||
|
println!(
|
||||||
|
" {:24} {}:{:?} {}",
|
||||||
|
f.control_refs.join(","),
|
||||||
|
f.file_path.as_deref().unwrap_or(""),
|
||||||
|
f.line_number,
|
||||||
|
f.title
|
||||||
|
);
|
||||||
|
}
|
||||||
|
let _ = std::fs::remove_dir_all(&repo);
|
||||||
|
|
||||||
|
assert!(
|
||||||
|
!findings.is_empty(),
|
||||||
|
"expected the grounded pass to flag at least one absence-based control"
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -76,14 +76,15 @@ pub struct BreakpilotConfig {
|
|||||||
/// Directory for catalog snapshots.
|
/// Directory for catalog snapshots.
|
||||||
pub snapshot_dir: String,
|
pub snapshot_dir: String,
|
||||||
/// Enable the master-controls **semantic** mapping pass (embed regions,
|
/// Enable the master-controls **semantic** mapping pass (embed regions,
|
||||||
/// retrieve nearest controls, grounded-judge). Off by default: it is the
|
/// Enable the master-controls **semantic** mapping pass (embed regions,
|
||||||
/// scale path and stays gated until verified live against a deployed
|
/// retrieve nearest controls, grounded-judge). On by default — validated live
|
||||||
/// master-controls catalog.
|
/// against the deployed master-controls catalog. Still a no-op unless
|
||||||
|
/// `base_url` is set and the catalog is reachable.
|
||||||
pub semantic_mapping: bool,
|
pub semantic_mapping: bool,
|
||||||
/// Enable the **grounded surface** pass for absence-based controls (retrieve
|
/// Enable the **grounded surface** pass for absence-based controls (retrieve
|
||||||
/// the code surface a control governs, judge whether it holds). Off by
|
/// the code surface a control governs, judge whether it holds). On by default
|
||||||
/// default: absence detection is the least deterministic path and stays gated
|
/// — validated live; it covers the 8 absence-based CRA controls that no
|
||||||
/// until tuned against live scans.
|
/// syntactic rule can.
|
||||||
pub grounded_control_checks: bool,
|
pub grounded_control_checks: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,8 +94,8 @@ impl Default for BreakpilotConfig {
|
|||||||
base_url: None,
|
base_url: None,
|
||||||
token: None,
|
token: None,
|
||||||
snapshot_dir: "/data/compliance-scanner/oscal".to_string(),
|
snapshot_dir: "/data/compliance-scanner/oscal".to_string(),
|
||||||
semantic_mapping: false,
|
semantic_mapping: true,
|
||||||
grounded_control_checks: false,
|
grounded_control_checks: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,9 +52,16 @@
|
|||||||
{
|
{
|
||||||
"control": "cra-ai-6",
|
"control": "cra-ai-6",
|
||||||
"title": "Integritaetspruefung",
|
"title": "Integritaetspruefung",
|
||||||
"scans": [],
|
"scans": [
|
||||||
"note": "absence-based — no syntactic pattern; covered by the grounded surface check (retrieve surface + LLM judge), gated (BREAKPILOT_GROUNDED_CHECKS) pending live tuning",
|
{
|
||||||
"status": "needs_tooling"
|
"tool": "grounded-control-check",
|
||||||
|
"scan_type": "code_review",
|
||||||
|
"cwe": [],
|
||||||
|
"rules": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"note": "covered by the grounded surface check (retrieve code surface + grounded LLM judge decides presence/absence); validated live",
|
||||||
|
"status": "covered"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"control": "cra-ai-7",
|
"control": "cra-ai-7",
|
||||||
@@ -138,16 +145,30 @@
|
|||||||
{
|
{
|
||||||
"control": "cra-ai-11",
|
"control": "cra-ai-11",
|
||||||
"title": "Brute-Force-Schutz",
|
"title": "Brute-Force-Schutz",
|
||||||
"scans": [],
|
"scans": [
|
||||||
"note": "absence-based — no syntactic pattern; covered by the grounded surface check (retrieve surface + LLM judge), gated (BREAKPILOT_GROUNDED_CHECKS) pending live tuning",
|
{
|
||||||
"status": "needs_tooling"
|
"tool": "grounded-control-check",
|
||||||
|
"scan_type": "code_review",
|
||||||
|
"cwe": [],
|
||||||
|
"rules": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"note": "covered by the grounded surface check (retrieve code surface + grounded LLM judge decides presence/absence); validated live",
|
||||||
|
"status": "covered"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"control": "cra-ai-12",
|
"control": "cra-ai-12",
|
||||||
"title": "Rollenbasierte Autorisierung",
|
"title": "Rollenbasierte Autorisierung",
|
||||||
"scans": [],
|
"scans": [
|
||||||
"note": "absence-based — no syntactic pattern; covered by the grounded surface check (retrieve surface + LLM judge), gated (BREAKPILOT_GROUNDED_CHECKS) pending live tuning",
|
{
|
||||||
"status": "needs_tooling"
|
"tool": "grounded-control-check",
|
||||||
|
"scan_type": "code_review",
|
||||||
|
"cwe": [],
|
||||||
|
"rules": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"note": "covered by the grounded surface check (retrieve code surface + grounded LLM judge decides presence/absence); validated live",
|
||||||
|
"status": "covered"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"control": "cra-ai-13",
|
"control": "cra-ai-13",
|
||||||
@@ -307,9 +328,16 @@
|
|||||||
{
|
{
|
||||||
"control": "cra-ai-24",
|
"control": "cra-ai-24",
|
||||||
"title": "Security-Logging",
|
"title": "Security-Logging",
|
||||||
"scans": [],
|
"scans": [
|
||||||
"note": "absence-based — no syntactic pattern; covered by the grounded surface check (retrieve surface + LLM judge), gated (BREAKPILOT_GROUNDED_CHECKS) pending live tuning",
|
{
|
||||||
"status": "needs_tooling"
|
"tool": "grounded-control-check",
|
||||||
|
"scan_type": "code_review",
|
||||||
|
"cwe": [],
|
||||||
|
"rules": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"note": "covered by the grounded surface check (retrieve code surface + grounded LLM judge decides presence/absence); validated live",
|
||||||
|
"status": "covered"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"control": "cra-ai-25",
|
"control": "cra-ai-25",
|
||||||
@@ -328,30 +356,58 @@
|
|||||||
{
|
{
|
||||||
"control": "cra-ai-27",
|
"control": "cra-ai-27",
|
||||||
"title": "Log-Integritaet und -Aufbewahrung",
|
"title": "Log-Integritaet und -Aufbewahrung",
|
||||||
"scans": [],
|
"scans": [
|
||||||
"note": "absence-based — no syntactic pattern; covered by the grounded surface check (retrieve surface + LLM judge), gated (BREAKPILOT_GROUNDED_CHECKS) pending live tuning",
|
{
|
||||||
"status": "needs_tooling"
|
"tool": "grounded-control-check",
|
||||||
|
"scan_type": "code_review",
|
||||||
|
"cwe": [],
|
||||||
|
"rules": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"note": "covered by the grounded surface check (retrieve code surface + grounded LLM judge decides presence/absence); validated live",
|
||||||
|
"status": "covered"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"control": "cra-ai-28",
|
"control": "cra-ai-28",
|
||||||
"title": "Sichere Update-Mechanismen",
|
"title": "Sichere Update-Mechanismen",
|
||||||
"scans": [],
|
"scans": [
|
||||||
"note": "absence-based — no syntactic pattern; covered by the grounded surface check (retrieve surface + LLM judge), gated (BREAKPILOT_GROUNDED_CHECKS) pending live tuning",
|
{
|
||||||
"status": "needs_tooling"
|
"tool": "grounded-control-check",
|
||||||
|
"scan_type": "code_review",
|
||||||
|
"cwe": [],
|
||||||
|
"rules": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"note": "covered by the grounded surface check (retrieve code surface + grounded LLM judge decides presence/absence); validated live",
|
||||||
|
"status": "covered"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"control": "cra-ai-29",
|
"control": "cra-ai-29",
|
||||||
"title": "Update-Authentizitaet",
|
"title": "Update-Authentizitaet",
|
||||||
"scans": [],
|
"scans": [
|
||||||
"note": "absence-based — no syntactic pattern; covered by the grounded surface check (retrieve surface + LLM judge), gated (BREAKPILOT_GROUNDED_CHECKS) pending live tuning",
|
{
|
||||||
"status": "needs_tooling"
|
"tool": "grounded-control-check",
|
||||||
|
"scan_type": "code_review",
|
||||||
|
"cwe": [],
|
||||||
|
"rules": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"note": "covered by the grounded surface check (retrieve code surface + grounded LLM judge decides presence/absence); validated live",
|
||||||
|
"status": "covered"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"control": "cra-ai-30",
|
"control": "cra-ai-30",
|
||||||
"title": "Update-Integritaet",
|
"title": "Update-Integritaet",
|
||||||
"scans": [],
|
"scans": [
|
||||||
"note": "absence-based — no syntactic pattern; covered by the grounded surface check (retrieve surface + LLM judge), gated (BREAKPILOT_GROUNDED_CHECKS) pending live tuning",
|
{
|
||||||
"status": "needs_tooling"
|
"tool": "grounded-control-check",
|
||||||
|
"scan_type": "code_review",
|
||||||
|
"cwe": [],
|
||||||
|
"rules": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"note": "covered by the grounded surface check (retrieve code surface + grounded LLM judge decides presence/absence); validated live",
|
||||||
|
"status": "covered"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"control": "cra-ai-31",
|
"control": "cra-ai-31",
|
||||||
|
|||||||
+12
-8
@@ -178,11 +178,13 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn every_bucket_is_represented() {
|
fn covered_and_not_checkable_are_populated() {
|
||||||
let s = ControlMap::cra().unwrap().summary();
|
let s = ControlMap::cra().unwrap().summary();
|
||||||
assert!(s.covered > 0);
|
assert!(s.covered > 0);
|
||||||
assert!(s.needs_tooling > 0);
|
|
||||||
assert!(s.not_code_checkable > 0);
|
assert!(s.not_code_checkable > 0);
|
||||||
|
// needs_tooling is now empty: every code-checkable control is either
|
||||||
|
// tool-covered or covered by the grounded surface pass.
|
||||||
|
assert_eq!(s.needs_tooling, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -215,14 +217,16 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn coverage_reflects_the_b_track_split() {
|
fn coverage_after_grounded_promotion() {
|
||||||
let s = ControlMap::cra().unwrap().summary();
|
let s = ControlMap::cra().unwrap().summary();
|
||||||
// 9 already tool-covered + B1's 4 custom-semgrep controls.
|
// 9 off-the-shelf + 4 custom-semgrep + 8 grounded surface controls (promoted
|
||||||
assert_eq!(s.covered, 13);
|
// after the grounded path was validated live).
|
||||||
// The 8 grounded surface controls stay needs_tooling until live-tuned.
|
assert_eq!(s.covered, 21);
|
||||||
assert_eq!(s.needs_tooling, 8);
|
// Nothing left as needs_tooling — every code-checkable control is covered.
|
||||||
// B3 marked the 4 pure-architectural controls not code-checkable.
|
assert_eq!(s.needs_tooling, 0);
|
||||||
|
// The 4 pure-architectural controls remain not code-checkable.
|
||||||
assert_eq!(s.not_code_checkable, 19);
|
assert_eq!(s.not_code_checkable, 19);
|
||||||
|
assert_eq!(s.total(), 40);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user