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
On top of the committed-binary inventory (#465), natively in Rust:
- PE: ASLR (DYNAMICBASE, relocations), high-entropy ASLR, DEP, CFG,
SafeSEH, /GS, Authenticode present; IL-only .NET assemblies skip the
native-only checks
- ELF (dynamically linked only): RELRO, NX stack, PIE, stack protector,
FORTIFY; static and bare-metal ELF are not assessed
- .NET: AssemblyRefs from the CLI metadata tables (own ECMA-335 reader)
- native PE: CPE/purl candidates from the version resource, low confidence
- Intel HEX: record checksums, address ranges, size, start address
Evidence goes on the inventory finding; each gap is its own Low/Info
finding per rule (grouped by #477). ASLR/NX/RELRO gaps bind to cra-ai-1 and
a damaged HEX image to cra-ai-6 through attach-only control-map bindings,
which never make a control count as checked.
PE/ELF headers are read with the object crate, already in the build via
firmwerk-sbom: no new crate, no Python helper, no image change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
Every CVE alert, and the SBOM's reference to the same advisory, now says
whether the CVE is exploited: its entry in CISA's KEV catalog (date added,
known ransomware use), FIRST's EPSS score and percentile, and the SSVC
exploitation decision of CISA's Vulnrichment.
- pipeline/cve_enrichment.rs reads KEV (one JSON, at most daily), EPSS
(FIRST API, 50 CVE ids per request) and Vulnrichment (per-CVE record on
raw.githubusercontent.com, a 404 is an answer) through guarded_net. Only
CVE ids leave the agent. Bounded: 500 uncached CVEs, 8 at once, 2 min.
- Answers are cached a day for all tenants in <prefix>__admin
(cve_exploitation per CVE, cisa_kev for the catalog), TTL index like the
NuGet licence cache. A failed source stays unknown, is not cached and
never fails the scan. CVE_EXPLOIT_LOOKUP=false turns it off.
- Runs in the scan (after the CVE stage), the PLC control-app path and the
hourly CVE monitor (which now refreshes an existing alert's exploitation).
- CVE issues (#452): a KEV CVE always opens an issue, rated at least high;
an EPSS percentile at or above CVE_ISSUE_EPSS_PERCENTILE (default 0.95)
rates it one step higher. The body names KEV, EPSS (with FIRST's credit)
and SSVC.
- LLM triage: a finding that names a CVE gets its exploitation in the
prompt. No scanner sets Finding.cve today, so this is a hook for now.
- Dashboard: "Aktiv ausgenutzt (KEV)" and "EPSS … · P…" badges on the SBOM
page's CVE cards, a KEV marker on the row, SSVC line, EPSS attribution.
- Docs: tools.md section and egress rows, SBOM and issues guides, staging
check 18. Tests run on trimmed real fixtures and a loopback stand-in.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
The CVE scanner asked api.osv.dev (querybatch, vulns/{id}) and NVD (per
CVE, per CPE product) with the agent's plain HTTP client. Every other
outbound call to an address the agent does not fully control is already
guarded, and since #468 the nuget.org license lookup is too.
New pipeline/public_http.rs (PublicHttp), the nuget_license pattern:
a guarded_client_builder client (approved addresses only, redirects
re-checked, no proxy), NetGuard::check_url before every request, 10 s
per request, 5 s connect, bodies capped at 16 MiB. CveScanner and
nvd_cpe::product_cves use it. NVD requests keep 30 s, as on the old
shared client (a product query returns up to 2,000 CVEs). A URL the
guard refuses is not retried.
CveScanner::new takes the agent's NetGuard instead of a client. The
dead search_context (SearXNG) is removed: it was never called, and an
internal SearXNG would be refused by the guard anyway. The orchestrator's
http field had no other user and is gone.
Audited every other reqwest client in compliance-agent. The LLM gateway,
tenant registry, OSCAL backend, GitLab/Jira trackers, identity providers
(pentest cleanup) and headless Chrome are operator-configured and often
internal, so they stay on plain clients. docs/reference/tools.md now
lists all egress in one place.
Tests: the OSV stand-in on loopback is refused with a public-only guard
(no request reaches it) and answers with allow_private. An NVD product
query to loopback is refused and not retried. check_url refuses
loopback, RFC 1918, link-local and metadata addresses, and a name that
resolves to loopback is refused when connecting.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
Syft names a DLL without a .deps.json by its version resource: product
name and file version. As a purl that is no NuGet package, so OSV
matched nothing: pkg:nuget/DotNetZip%20Library@1.9.1.5 has no advisory,
pkg:nuget/DotNetZip@1.9.1.5 has GHSA-7378-6268-4278.
Syft's dotnet-portable-executable-entry components are now mapped, in
this order:
- a DLL inside packages/<Id>.<Version>/ is that package
- a curated alias table, by assembly name (file name) and then product
name (DotNetZip Library -> DotNetZip, Json.NET -> Newtonsoft.Json,
Apache log4net -> log4net, Xceed Toolkit for WPF ->
Extended.Wpf.Toolkit, empira MigraDoc -> PDFsharp-MigraDoc), with how
the package's file versions relate to its versions (Newtonsoft.Json:
first three parts; EntityFramework: unrelated, so the DLL only
confirms a manifest entry)
- the assembly name, when it is a valid NuGet id and not one of the
tree's own projects (project name or <AssemblyName>), whose names are
not sent to OSV or nuget.org
- otherwise no purl, and the scan records the assembly as not matched
against OSV
Alias before file name: DotNetZip ships Ionic.Zip.dll, and Ionic.Zip is
a different package. Versions go through nuget_license's
normalise_version (4.1.0.0 -> 4.1.0, +build dropped); a non-zero fourth
part stays (1.9.1.5 is a real NuGet version).
One package found in several DLLs, or in a DLL and a manifest, is one
entry: SbomEntry gains `evidence` (the manifests and DLLs it was read
from), and merge_nuget compares normalised versions and merges the
evidence instead of dropping it. Native pe-binary components are left
as they are.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
The per-id retries of #472 ask about a finding up to three times, the
critical/high ones on their own. A model that accepts requests and never
answers would hold each call for the client's 300 s timeout: up to 720
calls instead of 60. When every call in flight fails at once, the model
is taken as down; what it answered so far is kept, the rest is recorded
as "skipped: no answer". An unreadable answer still counts as an answer
and is asked about again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
The LLM triage of the first pilot scans left 74 of 75 findings without a
triage_action. Three causes:
- Partial answers: 30 findings per call with a 4096-token budget that a
reasoning model spends on thinking and the answer together. The answer
was cut off after a few verdicts; #457 only retries an empty answer.
Verdicts were also matched by position and the echoed id was ignored,
so a finding the model left out shifted every later verdict.
- Not persisted: write_back stored triage fields only on rows this run
inserted. A rescan (or a scan restarted after stages 1-4 had saved its
findings) triaged them, then dropped the result.
- Unanswered findings were marked "triaged" and counted as "passed".
Now:
- 10 findings per call with a 12k budget (below #457's retry budget);
verdicts matched by id (the finding's number in the chunk, or its
fingerprint), by position only when the answer carries no ids
- findings without a verdict are asked again by id in chunks half the
size, then each critical/high one on its own
- one call per fingerprint: copies (gitleaks reports a secret once per
commit) share the verdict
- low/info findings are not sent; recorded as triage_action "skipped",
rationale "skipped: low"; likewise "skipped: over cap" and "skipped:
no answer". Skipped findings keep their status (open).
- write_back stores triage on rows an earlier run stored while nobody
has decided about them (open/triaged/needs_review); a skip never
replaces an earlier verdict; status still only onto open rows
- one summary line per scan replaces "N findings passed confidence
threshold": triaged by outcome, skipped by reason, LLM calls
- dismissed and low-confidence findings stay as needs_review (#367):
nothing is dropped
Tests drive the triage with a fake model: partial answer then retry by
id, malformed chunks, model down, threshold, lows and copies, and the
stored updates for new and earlier rows.
Closes#462
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
GET /api/v1/platform/version reported the crate version (0.4.4) and no
commit, so the portal's staff dashboard showed Prüfwerk without one. The
agent now reads PRUEFWERK_VERSION and PRUEFWERK_COMMIT at compile time;
the deploy-agent job passes the latest v* tag (without its v) and the
commit as Docker build args, like the tenant-registry's GET /version.
Locally, or with empty args, it falls back to the crate version and
"unknown".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
NuGet SBOM entries carried no license: none of the files they come from
names one. Fill it in after the NuGet components are merged (#467):
- local first: the .nuspec of a restored package; <license
type="expression"> as SPDX, type="file" as LicenseRef-file, an old
<licenseUrl> mapped to SPDX for well-known license pages, else kept
- then nuget.org: registration leaf (gzip) -> catalogEntry (inline or
linked on api.nuget.org) -> licenseExpression / licenseFile / licenseUrl
- only real ids at exact versions (no ranges, no DLL-metadata names);
versions normalised as nuget.org files them (6.2.0.0 -> 6.2.0, 2.0 ->
2.0.0)
- ids a nuget.config maps to another feed are never sent; a tree whose
nuget.config lists another feed without a mapping is not looked up
- through guarded_net, 8 at once, 10 s per request, 60 s and 300
uncached packages per scan; failures stay empty, one warning per scan
- cached across tenants in the admin database (nuget_licenses, TTL: a
year for a license, a week for none)
- NUGET_LICENSE_LOOKUP=false turns the nuget.org step off
Closes#467
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
Minimal .NET/C# support for epic #445 (N1-N5): detection of solutions/projects and target frameworks, NuGet SBOM without build or restore (pkg:nuget purls for OSV, unresolved-dependency warning, end-of-support frameworks), own C# semgrep rule pack, .NET configuration and key-file checks, .NET build output and restored packages not counted as own code. Fixture fixtures/dotnet/framework48, docs .NET-Projekte (DE/EN).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
Every member of a tenant could use Prüfwerk fully, whatever their org
role: nothing but manual findings checked org_roles. A FINANCE user
could create and delete targets, start scans and triage findings.
Now, as decided on 30.09.2026:
- IT_ADMIN, USER: read and write.
- CXO, LEGAL: read only. GET/HEAD/OPTIONS plus the POSTs that only
read (OSCAL assess, pentest report export, code chat, help chat).
- FINANCE or no role: no access.
- Agent: one middleware (api::role_gate) right after the JWT one
refuses with 403 {"error":"forbidden_role","access":...}. It is
classified by route template, so ids do not matter. Support sessions
(TenantContext.staff) and requests without a tenant context
(platform service API, Werkbank runner and admin APIs, health) are
unchanged. Manual findings stay IT_ADMIN-only.
- Core: ProductAccess and TenantContext::product_access.
- Dashboard: a role without access sees a "no access" page (DE/EN)
with a link back to the portal, and no server function runs for it.
Read-only roles get a read-only note, and write actions (add target,
scan, edit, delete, triage, tokens, MCP servers, pentest control,
graph/embedding builds, notification dismiss) are hidden. The direct
MCP server functions check the role, and access tokens are withheld
from read-only roles.
- MCP server: unchanged. Its tokens are tenant-bound and carry no
roles, its tools only read, and creating a token now needs write
access.
- Docs: the roles table in Getting Started.
- The crates are at version 0.4.4.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
The dashboard, the docs site and the pentest report no longer load
Google Fonts, so no visitor's IP goes to Google (platform/portal#65,
privacy release gate 4).
- Dashboard: Geist and Geist Mono (variable woff2, SIL OFL 1.1) are
embedded and served at /fonts/geist.woff2 and /fonts/geist-mono.woff2;
main.css declares them with @font-face under the same family names.
- Docs: the same woff2 files are bundled by Vite from the theme; the
Google Fonts links in config.mts are gone.
- Pentest report: preconnects and the Google Fonts stylesheet removed;
a system font stack instead, with a test that the report references
no external resource.
- The crates are at version 0.4.3.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB