fix(yocto): recipe lint binds attack-surface findings to cra-ai-2 and counts suppressed findings
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 8m54s

- oelint.task.network and yocto-src-uri-http bind to cra-ai-2 (attack
  surface) instead of cra-ai-6. cra-ai-2 stays not code-checkable; the CRA
  status assesses it only where one of its bindings applies to the scanned
  languages, which today means a Yocto layer tree (bitbake). The test that
  pinned cra-ai-2 as binding-free now allows exactly these two.
- `# nooelint` suppressions stay honoured, and are counted: the suppressions
  of our rules in the linted recipes, less those oelint-adv reports as not
  needed (oelint.file.inlinesuppress_na, now in the rule file). A count above
  zero is logged at INFO and recorded on the run as the stage
  recipe_lint_suppressed with the new SkipCode::SuppressedInSource; the
  dashboard words it in German and English.
- docs/guide/yocto.md: upstream layers are recognised by collection name, so
  a fork that keeps it is skipped; the suppression note; cra-ai-2.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
This commit is contained in:
Sharang ParnerkarandClaude Opus 5.5 committed 2026-10-09 18:37:32 +02:00
1 parent ac50880b25
commit ecf0e34e8c
10 files changed
+366 -70

No files matched your search

+29 -17
View File
@@ -145,8 +145,33 @@
{
"control": "cra-ai-2",
"title": "Minimale Angriffsfläche",
"scans": [],
"note": "design property (minimal attack surface) — not derivable from local code patterns; architecture/threat-model review",
"scans": [
{
"tool": "oelint-adv",
"scan_type": "recipe_lint",
"languages": [
"bitbake"
],
"cwe": [],
"rules": [
"oelint.task.network"
],
"check": "The build must not open interfaces it does not need: a build task given network access fetches outside the checksummed fetcher and widens what can reach into the image, which violates it."
},
{
"tool": "yocto-config",
"scan_type": "recipe_lint",
"languages": [
"bitbake"
],
"cwe": [],
"rules": [
"yocto-src-uri-http"
],
"check": "The build must not take its sources over an unauthenticated interface: a source fetched over plain http can be swapped on the way, which violates it."
}
],
"note": "design property (minimal attack surface) — not derivable from local code patterns; architecture/threat-model review; on Yocto layer trees only, recipe lint checks build tasks with network access and plain-http fetches",
"status": "not_code_checkable"
},
{
@@ -215,22 +240,9 @@
"rules": [
"oelint.vars.srcurichecksum",
"oelint.vars.autorev",
"oelint.vars.srcurigittag",
"oelint.task.network"
"oelint.vars.srcurigittag"
],
"check": "What the image is built from must be verifiable: a download without a checksum, a source that follows a branch head (AUTOREV) or a movable tag, or a build task that fetches over the network outside the checksummed fetcher violates it."
},
{
"tool": "yocto-config",
"scan_type": "recipe_lint",
"languages": [
"bitbake"
],
"cwe": [],
"rules": [
"yocto-src-uri-http"
],
"check": "What the image is built from must be fetched over an authenticated channel: a source fetched over plain http violates it."
"check": "What the image is built from must be verifiable: a download without a checksum, or a source that follows a branch head (AUTOREV) or a movable tag, violates it."
}
],
"note": "covered by the grounded surface check (retrieve code surface + grounded LLM judge decides presence/absence); validated live",
+29 -4
View File
@@ -356,16 +356,17 @@ mod tests {
"oelint.vars.srcurichecksum",
"oelint.vars.autorev",
"oelint.vars.srcurigittag",
"oelint.task.network",
] {
assert_eq!(controls("oelint-adv", rule), ["cra-ai-6"], "{rule}");
}
// The attack-surface rules.
assert_eq!(controls("oelint-adv", "oelint.task.network"), ["cra-ai-2"]);
assert!(controls("oelint-adv", "oelint.vars.insaneskip").is_empty());
assert_eq!(
controls("yocto-config", "yocto-extrausers-password"),
["cra-ai-8"]
);
assert_eq!(controls("yocto-config", "yocto-src-uri-http"), ["cra-ai-6"]);
assert_eq!(controls("yocto-config", "yocto-src-uri-http"), ["cra-ai-2"]);
assert_eq!(
controls("yocto-config", "yocto-sshd-root-login"),
["cra-ai-1"]
@@ -375,7 +376,7 @@ mod tests {
assert!(controls("semgrep", debug).is_empty());
// A layer tree is checked for these controls.
let bitbake = ["bitbake".to_string()];
for id in ["cra-ai-1", "cra-ai-6", "cra-ai-8"] {
for id in ["cra-ai-1", "cra-ai-2", "cra-ai-6", "cra-ai-8"] {
assert!(map.coverage(id).expect(id).checked_for(&bitbake), "{id}");
}
}
@@ -455,7 +456,31 @@ mod tests {
for id in ["cra-ai-2", "cra-ai-3", "cra-ai-4", "cra-ai-5"] {
let c = map.coverage(id).unwrap();
assert_eq!(c.status, Coverage::NotCodeCheckable, "{id}");
assert!(c.scans.is_empty(), "{id} should carry no scan bindings");
// Only cra-ai-2 carries bindings, and only the Yocto recipe
// lint's attack-surface rules: no other code is checked for it.
let bound: Vec<(&str, &str, &[String])> = c
.scans
.iter()
.flat_map(|s| {
s.rules
.iter()
.map(move |r| (s.tool.as_str(), r.as_str(), s.languages.as_slice()))
})
.collect();
let bitbake = ["bitbake".to_string()];
let expected: Vec<(&str, &str, &[String])> = if id == "cra-ai-2" {
vec![
("oelint-adv", "oelint.task.network", &bitbake),
("yocto-config", "yocto-src-uri-http", &bitbake),
]
} else {
Vec::new()
};
assert_eq!(bound, expected, "{id}");
assert!(c
.scans
.iter()
.all(|s| s.scan_type == "recipe_lint" && s.cwe.is_empty()));
}
}