The CVE monitor asked only OSV, so Yocto recipes, header-detected embedded
libraries and the CODESYS runtime were re-matched in NVD only by a scan.
A new NVD pass (pipeline/nvd_monitor.rs) reads NVD's lastMod listing
(lastModStartDate/lastModEndDate, windows of at most 120 days, 500 CVEs per
page, one listing for all tenants) and matches the changed CVEs locally with
the scan's rules (virtualMatchString semantics, marker, version range).
- Cursor in the admin DB (done_until + open window/startIndex/total): a run
stopped by its 10-minute budget, an NVD or a database error continues
there; a listing that shrinks while paged is re-read from earlier.
- Paced with nvd_cpe::request_interval (0.6 s with NVD_API_KEY, 6 s
without), reusing the nvd_cpe client (fetch with retries, factored out).
- Matches become the scan's CveAlert (purl, cvss, repo_id), stored with
$setOnInsert on (cve_id, repo_id) (vex_lifecycle::store_monitored, now
shared with the OSV pass), VEX attached, notify_new_cves, and CVE issues
for new alerts via the shared CveIssueSync (incomplete: closes nothing).
- One INFO line per tenant with counts; NVD_MONITOR=off turns it off
(default on).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
Blessed by the nightly run 8514 (workflow_dispatch, bless) on the image of
34e3f6c: the vendored gitlab-/0xdea- rules in fw-c-sensor-node, the Python
targets, archive-order-intake and git-cra-vuln-demo, and new baselines for
the .NET targets dotnet-framework48 and dotnet-legacy-sample (DevSkim, the
C# semgrep rules and the .NET config checks). py-uv also records the
malware stage as skipped and one more PYSEC id, as the current image
reports them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
Legacy .NET Framework code often cannot be built outside the customer's
Windows toolchain, so no Roslyn analyser applies. DevSkim (MIT, Microsoft)
matches its rules on the source text and now runs as the sast_dotnet stage
on every tree with C# or VB.NET code: .cs, .vb, Razor/ASP.NET pages and
.config files, skipping bin/, obj/, packages/ and vendor directories
(anchored at the tree root).
- Only DevSkim's own rules at Critical/Important/Moderate (its ManualReview
and BestPractice hints are not findings); DS205000 (NuGet feed mapping),
DS184626 (controller base class) and DS440000 (generic twin of DS440020)
are left out, and two that flood real C# (OpenRA, eShopOnWeb): DS148264
matches any method named Random (71 hits in OpenRA), DS126858 the bare
words md5/sha1, identifiers included (35). DS168931 and our own semgrep
rules still cover broken hashes and System.Random. What remains: 3 hits
in OpenRA (test vectors), 14 Low http:// hits in eShopOnWeb seed data;
each run took about 2 s.
- SARIF is read with import::sarif::parse; findings are normalised like the
other scanners (relative path, whole source line as snippet, one finding
per rule/file/line), severity from DevSkim's own Critical/Important/
Moderate (its SARIF level says "error" for both of the first two).
- DevSkim's SARIF names no CWE, so pipeline/devskim.rs gives each rule one;
the control map binds the devskim tool by CWE to cra-ai-1, 8, 10, 13, 14,
15, 16 and 20 for csharp and vb. A test checks every mapped rule reaches a
control. A failed run is a sast_dotnet skip, so those controls read "not
assessed" instead of clean.
- languages.rs now records VB.NET (vb).
Image: the CLI is published as a .NET tool on nuget.org only (no release
binaries). Dockerfile.agent pins the 1.0.100 nupkg by sha256 and the .NET
10.0.12 runtime (no SDK) by sha512, keeps only the linux-x64 natives, and
runs it through docker/devskim.sh with invariant globalisation (no ICU).
The tools stage grows from 1.525 GB to 1.623 GB (+98.5 MB: runtime 80 MB,
DevSkim 16 MB). Checked in that image as the unprivileged user with an empty
environment and --network none: it runs offline. tool-versions.json lists
devskim and dotnet-runtime.
Fixtures: fixtures/dotnet/legacy-sample, a small vulnerable C#/VB.NET
library with a Web.config (SSL 3, certificate validation off, DES, XXE,
BinaryFormatter in VB.NET, tracing, cookies without Secure), and nightly
targets for it and for framework48; their baselines need a bless run after
deploy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
At the end of every completed scan the target's CycloneDX SBOM (the same
document as the evidence pack's sbom.cdx.json) is scored by sbomqs against
BSI TR-03183-2 v2.1 and the NTIA minimum elements (2021).
- Dockerfile.agent pins sbomqs 2.1.2 (Apache-2.0) with the sha256 from the
release's checksums.txt and lists it in tool-versions.json.
- Profiles by explicit name (bsi-v2.1, ntia-2021): in 2.1.2 `bsi` and
`ntia` float to the newest BSI and CISA 2026 profiles.
- pipeline/sbom_quality.rs runs it offline through tool_cmd (empty
environment, 120 s), keeps per profile the score, grade and the checks
not fully met; stored on the scan run as sbom_quality. Without sbomqs the
run records the skipped stage sbom_quality.
- Supporting evidence, not findings: attached to cra-ai-23 in the CRA
status without changing its state, sbom-quality.json in the evidence
pack, GET /api/v1/sbom/quality for the SBOM page.
- Dashboard: SBOM-Qualität card on the SBOM page, a supporting-evidence line
on cra-ai-23 on the CRA page.
- Docs: tools.md, SBOM and target guides, staging check 20.
Our export (CycloneDX 1.5, no creator, timestamp, supplier or hashes)
grades F against BSI; the failed checks list what it needs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
Our ~35 own rules left whole languages without SAST findings. Three
permissively licensed community packs now run next to them, on the same
semgrep invocation (--metrics=off, local files only):
- GitLab sast-rules v2.10.1 (53bf5cf6): 148 rules for C#, Java,
JavaScript/TypeScript, Python and one Go rule; only files whose header says
"License: MIT (c) GitLab Inc.". Not vendored: c/ (every file GPL-2.0,
generated from flawfinder), go/ apart from one file (Apache-2.0 gosec
ports), scala/, rules/lgpl, rules/lgpl-cc (Commons Clause), rules/gitlab (EE).
- 0xdea semgrep-rules (dae50da6, MIT): 35 C/C++ rules.
- elttam semgrep-rules (24426856, MIT; its LICENSE carries the Semgrep
template's copyright line): 34 rules for Java, Go and Struts/Spring XML.
Each pack lives in compliance-agent/rules/vendor/<source>/ with LICENSE,
NOTICE (provenance, what was left out and why) and UPSTREAM (pinned commit):
upstream/ holds the selected files unchanged with their tests, pack.yaml the
rules the agent runs, ids prefixed per source (gitlab-, 0xdea-, elttam-),
rules.json an index for the tests. scripts/vendor-semgrep-rules.py
regenerates all of it deterministically.
Provenance: every candidate rule was compared with the Semgrep registry
(semgrep/semgrep-rules, read only for the comparison). Eight GitLab Python/JS
rules with the same message or the same patterns are not vendored, nor are
elttam's Kubernetes rules (registry-derived). Also left out: elttam's
entrypoint enumerators, its ORM-leak hints, three files whose upstream
tests fail on semgrep 1.177 and a join-mode rule.
Noise budget: run over the nightly fixtures, the public samples and
FreeRTOS-Kernel, lwIP, OpenRA, eShopOnWeb, requests, express and
spring-petclinic. 15 rules that flood real code (0xdea missing-return 1514
hits, typos 989, interesting-api-calls 718, signed-unsigned-conversion 221,
suspicious-assert 176, format-string-bugs 61 ...; GitLab assert-used) are
dropped from the pack, each listed with its reason in NOTICE. CPU time of
the semgrep run roughly doubles on C-heavy trees (FreeRTOS-Kernel 70 s ->
136 s, lwIP 18 s -> 68 s), well inside the 10-minute stage timeout.
Ids stay bare (#473 logic covers the vendored ids, fingerprint() unchanged).
The control map gets one vendored semgrep binding per control, by CWE (by
rule id for the few elttam rules without one), with exactly the languages of
the rules behind it; a test checks every vendored rule maps to a control
that claims its languages.
Guard: semgrep_args() builds the one invocation; a test fails if any
--config is not a staged local pack, or is auto, p/, r/ or a URL, and
another scans the agent source, scripts, docker/, CI and Dockerfile.agent for
a registry config.
Nightly baselines with C, Python, C# or JS code change and need a bless run
after the image is deployed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB