fix(agent): CVE tickets name the CRA requirements, not their ids
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 / Agent integration (pull_request) Successful in 5m13s
CI / Check (pull_request) Failing after 10m15s

The CRA section of a CVE issue listed cra-ai-22 and cra-ai-33 with the
catalog titles; it now reads like the finding issues, by the requirement
names in both languages, through the same helper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
This commit is contained in:
Sharang ParnerkarandClaude Opus 5.5 committed 2026-11-27 20:32:22 +01:00
1 parent 5b6a4b8d49
commit 5af5406b64
2 files changed
+6 -10

No files matched your search

+4 -9
View File
@@ -456,14 +456,8 @@ fn issue_body(alert: &CveAlert, severity: &str, target_id: &str, dashboard: &str
)); ));
} }
body.push_str("\n### CRA\n\n"); body.push_str("\n### CRA\n\n");
let map = control_map::ControlMap::cra().ok(); for requirement in crate::pipeline::issue_creation::cra_requirements(&CVE_CONTROLS) {
for id in CVE_CONTROLS { body.push_str(&format!("- {requirement}\n"));
let title = map
.as_ref()
.and_then(|m| m.coverage(id))
.map(|c| c.title.clone())
.unwrap_or_default();
body.push_str(&format!("- {id} — {title} (Annex I)\n"));
} }
let dashboard = dashboard.trim_end_matches('/'); let dashboard = dashboard.trim_end_matches('/');
if dashboard.starts_with("https://") { if dashboard.starts_with("https://") {
@@ -763,7 +757,8 @@ mod tests {
// pruefwerk (1), cra:annex-i (2), severity:high (4), cve (7). // pruefwerk (1), cra:annex-i (2), severity:high (4), cve (7).
assert!(calls[0].ends_with("labels=[1,2,4,7]"), "{}", calls[0]); assert!(calls[0].ends_with("labels=[1,2,4,7]"), "{}", calls[0]);
assert!(calls[1].contains("Fixed in: 4.9.2")); assert!(calls[1].contains("Fixed in: 4.9.2"));
assert!(calls[1].contains("cra-ai-22")); assert!(calls[1].contains("Bekannte Schwachstellen in Komponenten"));
assert!(!calls[1].contains("cra-ai-22"));
assert!(calls[1].contains("https://pruefwerk.example/targets/target-1")); assert!(calls[1].contains("https://pruefwerk.example/targets/target-1"));
} }
@@ -690,9 +690,10 @@ pub(super) fn format_issue_body(finding: &Finding) -> String {
/// `control_refs`, by the name a customer reads in both languages /// `control_refs`, by the name a customer reads in both languages
/// (`Keine Standardpasswörter / No default passwords (Annex I)`). An id /// (`Keine Standardpasswörter / No default passwords (Annex I)`). An id
/// outside the 40 requirements stays as it is. /// outside the 40 requirements stays as it is.
fn cra_requirements(control_refs: &[String]) -> Vec<String> { pub(crate) fn cra_requirements<S: AsRef<str>>(control_refs: &[S]) -> Vec<String> {
control_refs control_refs
.iter() .iter()
.map(AsRef::as_ref)
.filter(|id| id.starts_with("cra-")) .filter(|id| id.starts_with("cra-"))
.map(|id| match compliance_core::cra_requirements::name(id) { .map(|id| match compliance_core::cra_requirements::name(id) {
Some(name) => format!("{} / {} (Annex I)", name.de, name.en), Some(name) => format!("{} / {} (Annex I)", name.de, name.en),