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

+2 -2
View File
@@ -30,9 +30,9 @@ For the **CRA** framework (40 controls) the split is **21 covered · 0 needs_too
- **Vendored semgrep packs** (GitLab, 0xdea, elttam; #492), bound **by CWE** like off-the-shelf tools, on a semgrep binding of their own per control whose `languages` are exactly those of the vendored rules under those CWEs (a test checks every vendored rule maps to a control that claims its languages). The few elttam rules without a CWE are bound by rule id. Because these bindings are `semgrep` bindings, a CWE they list also attaches our own semgrep findings with that CWE to the control.
- **mobsfscan** for Android and iOS apps, bound **by CWE** (a mobsfscan binding only ever attaches mobsfscan findings): `cra-ai-1` (debuggable, exported components, outdated `minSdkVersion`), `7`, `8`, `9`, `13`, `14`, `15` (cleartext, TLS, App Transport Security), `16` and `20`. Each binding lists only the languages mobsfscan has rules for under those CWEs, so `cra-ai-1` covers Java and Kotlin (its manifest checks) but not Swift.
- **DevSkim** for C# and VB.NET (#494), bound **by CWE** (each DevSkim rule gets its CWE in `pipeline/devskim.rs`; its SARIF carries none): `cra-ai-1` (tracing), `8`, `10` (cookies without Secure), `13`, `14` (DPAPI without entropy), `15`, `16` and `20` (deserialisation, XXE).
- **Yocto recipe lint** (oelint-adv and our `yocto-config` rules), bound **by rule id** with the language `bitbake`: `cra-ai-1` (debug and root-login image features, sshd root/password logins, a distro without `security_flags.inc`), `cra-ai-8` (empty-password image features, passwords in `EXTRA_USERS_PARAMS`) and `cra-ai-6` (downloads without a checksum, `AUTOREV`, git tags, network access in tasks, `http://` fetches). The attack-surface rules (network tasks, `http://`) bind to `cra-ai-6` because `cra-ai-2` stays not code-checkable.
- **Yocto recipe lint** (oelint-adv and our `yocto-config` rules), bound **by rule id** with the language `bitbake`: `cra-ai-1` (debug and root-login image features, sshd root/password logins, a distro without `security_flags.inc`), `cra-ai-8` (empty-password image features, passwords in `EXTRA_USERS_PARAMS`) `cra-ai-6` (downloads without a checksum, `AUTOREV`, git tags) and `cra-ai-2` (network access in tasks, `http://` fetches). `cra-ai-2` stays not code-checkable; these are its only bindings, so the CRA status assesses it only where the scanned languages include `bitbake` (a Yocto layer tree), and shows it as not code-checkable everywhere else.
- **8 grounded surface checks** (`cra-ai-6`, `11`, `12`, `24`, `27`, `28`, `29`, `30`): the absence-based controls (no rate limiting, no security logging, no update-signature check…) that have no syntactic pattern.
- **Marked not_code_checkable** (`cra-ai-2`, `3`, `4`, `5`, among the 19): minimal attack surface, secure architecture, least privilege, tamper protection.
- **Marked not_code_checkable** (`cra-ai-2`, `3`, `4`, `5`, among the 19): minimal attack surface, secure architecture, least privilege, tamper protection. A not-code-checkable control with a binding that applies to the scanned languages is assessed like a covered one there; today that is only `cra-ai-2` on Yocto layer trees.
### Languages, and what the CRA status may claim
+14 -4
View File
@@ -61,12 +61,14 @@ rules only, none of its style rules:
| `oelint.vars.srcurichecksum` (download without `SRC_URI[sha256sum]`) | medium | (2)(f) integrity | CRA-AI-6 |
| `oelint.vars.autorev` (`SRCREV = "${AUTOREV}"`) | medium | (2)(f) | CRA-AI-6 |
| `oelint.vars.srcurigittag` (git `tag=` instead of a commit; up to Walnascar) | low | (2)(f) | CRA-AI-6 |
| `oelint.task.network` (a task with `[network] = "1"`) | medium | (2)(j) attack surface | CRA-AI-6 |
| `oelint.task.network` (a task with `[network] = "1"`) | medium | (2)(j) attack surface | CRA-AI-2 |
| `oelint.vars.insaneskip` (QA checks skipped) | low | informational | none |
A `.oelint.cfg` in the repository is ignored, so it cannot switch rules off;
`# nooelint:` comments in a recipe do suppress a finding there, as oelint-adv
intends. If oelint-adv does not complete, the run lists **Rezept-Prüfung (Yocto)**
intends. Suppressed findings are not shown, so the run counts them and lists
"N Befunde sind per Kommentar in den Rezepten (# nooelint) unterdrückt" under
**Rezept-Prüfung: unterdrückte Befunde**. If oelint-adv does not complete, the run lists **Rezept-Prüfung (Yocto)**
under **Nicht ausgeführt**, and the controls it checks count as not assessed.
**Our own rules** (`yocto-config`):
@@ -74,7 +76,7 @@ under **Nicht ausgeführt**, and the controls it checks count as not assessed.
| Rule | Finds | Severity | CRA Annex I | Control |
| --- | --- | --- | --- | --- |
| `yocto-extrausers-password` | `useradd`/`usermod` with `-p`/`-P`/`--password` in `EXTRA_USERS_PARAMS` (a hash, clear text or an empty password; `'*'` and `'!'` lock the account and are fine, a `${VARIABLE}` is not judged). The value is hidden in the finding. | high | (2)(b) | CRA-AI-8 |
| `yocto-src-uri-http` | `http://` or `protocol=http` in `SRC_URI` | medium | (2)(j) | CRA-AI-6 |
| `yocto-src-uri-http` | `http://` or `protocol=http` in `SRC_URI` | medium | (2)(j) | CRA-AI-2 |
| `yocto-sshd-root-login` | `PermitRootLogin yes` in an `sshd_config*` shipped under `recipes-*` | high | (2)(b) | CRA-AI-1 |
| `yocto-sshd-password-auth` | `PasswordAuthentication yes` there | medium | (2)(b) | CRA-AI-1 |
| `yocto-distro-no-security-flags` | a `conf/distro/*.conf` that does not require `security_flags.inc`, itself or through the includes in the repository | medium | (2)(b) | CRA-AI-1 |
@@ -89,7 +91,15 @@ such a distro is not reported; an include in the repository is followed.
**Upstream layers** (OpenEmbedded-Core and Poky, meta-openembedded, and widely
used security, virtualisation and BSP layers, recognised by their
`BBFILE_COLLECTIONS`) are not linted: their findings are upstream's. The run names
them under **Nicht ausgeführt** as "Upstream-Layer".
them under **Nicht ausgeführt** as "Upstream-Layer". A layer is recognised by its
collection name, not its contents: a fork of an upstream layer that keeps the
upstream collection name (`core`, `openembedded-layer`, `freescale-layer`, …) is
skipped too. Give your fork its own collection name to have it linted.
CRA-AI-2 (minimal attack surface) is otherwise outside static scans. On a Yocto
layer tree, recipe lint checks it (network access in build tasks, plain-http
fetches), so the CRA status assesses it there; for every other target it stays
"not code-checkable".
## Recipe inventory