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. An NVD product query gets 30 s (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
15 KiB
Tools & Scanners
Prüfwerk uses a combination of open-source scanners and AI-powered analysis to provide comprehensive security coverage. This page describes each tool and how it contributes to the scan pipeline.
Semgrep -- Static Analysis (SAST)
Semgrep is an open-source static analysis engine (LGPL-2.1) that finds vulnerabilities by matching patterns in source code.
Prüfwerk runs the engine with its own CRA rules only:
- Python and JavaScript/TypeScript: secure defaults, weak password hashing,
insecure session cookies, weak ciphers for data at rest, shell commands and
SQL statements built from variables, request input echoed into a response,
plain
http://requests, and (Python) hard-coded credentials. - C and C++: unbounded string functions, non-literal format strings,
hard-coded credentials, broken hashes and ciphers,
rand()for security.
The rules of the Semgrep registry (--config=auto, p/...) are not used:
their licence (Semgrep Rules License v1.0) allows internal use only, not a
service offered to others, and auto cannot run without sending metrics to
Semgrep. Semgrep runs with --metrics=off and no version check, so nothing
about your code leaves the scan. Code in other languages gets no Semgrep
findings; the CRA view says so (Keine Prüfregel für den gefundenen Code)
instead of reporting it as clean.
Semgrep produces Codeanalyse (SAST) findings with file paths, line numbers, and rule descriptions.
cppcheck -- C and C++ Analysis
cppcheck runs on trees with C or C++ code.
Where Semgrep matches patterns, cppcheck follows values through the code, which
finds the defects that matter in firmware: out-of-bounds writes, uninitialised
reads, null dereferences and leaks. It parses the code and never runs it. Its
findings are Codeanalyse (SAST) findings with the tool name cppcheck.
mobsfscan -- Android and iOS Apps
mobsfscan (LGPL-3.0, used unchanged) runs on trees with Java, Kotlin, Swift or Objective-C code. It checks the code and the app settings:
- AndroidManifest.xml:
debuggable,allowBackup, cleartext traffic, an outdatedminSdkVersion, exported components, task hijacking. - Info.plist: App Transport Security exceptions (
NSAllowsArbitraryLoads). - Code: WebViews with a JavaScript bridge or ignored TLS errors, weak hashes
and ciphers, ECB mode and static IVs,
java.util.Randomfor security, world-readable storage, trust-all certificate handling, command and SQL injection, unsafe deserialisation, sensitive data in logs.
Each finding carries its CWE and the OWASP MASVS requirement. mobsfscan runs
once with the Android and once with the iOS rules when a repository holds both
apps (React Native, Flutter); on its own it would check such a repository as
Android only. It runs on the same Semgrep engine with metrics off, never reads
a .mobsf file from your repository, and skips Pods/, build/, .gradle/,
DerivedData/, Carthage/ and node_modules/. Its findings are
Codeanalyse (SAST) findings with the tool name mobsfscan.
Not reported: the app-wide "missing protection" hints (no certificate pinning, no root or jailbreak detection, no screenshot protection). They name no place in the code and are heuristics. Dart code (Flutter) has no rules yet.
Vendor Code Exclusion
Firmware projects carry their silicon vendor's SDK (HAL, CMSIS, board support) and third-party middleware next to their own code. Findings in that code are not yours to fix, so it is left out of the code findings (SAST, patterns, secrets, lint). What counts as vendor code:
- directories named
CMSIS,Third_Party,vendor(and similar), or ending in_HAL_Driver/_StdPeriph_Driver; - ST's generated layouts (
Drivers/next toCore/,Middlewares/); - a vendored library wherever it sits, recognised by the files it always ships (Mbed TLS, lwIP, the FreeRTOS kernel, wolfSSL, FatFs);
- build output and installed third-party code of apps, when committed:
Gradle's
build/beside abuild.gradleand.gradle/,Pods/beside aPodfile,Carthage/beside aCartfile,DerivedData/, and in a Unity project (besideProjectSettings/)Library/,Temp/,Obj/,Logs/,Builds/,UserSettings/and the Asset Store packages inAssets/Plugins/.
Your own src/drivers/ is not excluded. The scan run lists the excluded
directories under Nicht ausgeführt as Herstellercode (HAL, CMSIS,
Drittanbieter). The excluded code stays in the SBOM and is checked for known
vulnerabilities.
Syft -- SBOM Generation
Syft is an open-source tool for generating Software Bills of Materials. It scans your repository and identifies every dependency, including:
- Package name and version
- Package manager (npm, cargo, pip, go, maven, nuget, composer, gem)
- License information
Syft output feeds into both the SBOM feature and the vulnerability scanning pipeline.
Embedded Library Versions
Libraries copied into a firmware tree have no manifest Syft could read.
Prüfwerk recognises FreeRTOS, FreeRTOS+TCP, lwIP, Mbed TLS,
wolfSSL and FatFs and reads each version from the library's own header
(for example task.h, FreeRTOS_IP.h, lwIP's init.h, ff.h). They are added
to the SBOM with the package source embedded and matched against NVD by CPE.
OSV.dev + NVD -- Vulnerability Matching
Prüfwerk matches every SBOM component directly against two public vulnerability sources (no separate scanner binary):
- OSV.dev -- batch queried by package URL (purl) for ecosystem advisories (npm, PyPI, crates.io, Go, Maven, ...)
- NVD -- queried per CVE for the CVSS v3.1 base score, and by CPE for components outside a package ecosystem: the CODESYS runtime found in PLC projects and the embedded libraries above. All CVEs of the product are fetched and their affected version ranges compared with the version in use.
Matches are stored as CVE alerts with CVSS scores and re-checked hourly, so newly published CVEs against an unchanged dependency still raise a notification.
Only package URLs (purl), CVE ids and CPE product prefixes are sent. Both sources are reached through the net guard like every other outbound request (see Outbound connections).
nuget.org -- NuGet Licenses
Licenses of NuGet packages that no .nuspec in the tree gives are read from the nuget.org registration API (api.nuget.org). Only the package id and version are sent, never for an id a nuget.config routes to another feed (see .NET projects). The lookup is bounded per scan (8 requests at once, 10 s per request, 60 s and 300 uncached packages in total); answers are cached for all tenants. Set NUGET_LICENSE_LOOKUP=false to keep the agent from contacting nuget.org.
Custom OAuth Scanner
A purpose-built scanner that detects OAuth and OIDC misconfigurations in your code, including:
- Missing state parameter validation
- Insecure token storage
- Incorrect redirect URI handling
- Missing PKCE implementation
- Token exposure in logs or URLs
Custom GDPR Scanner
A scanner focused on data protection compliance, detecting:
- Personal data handling without consent checks
- Missing data retention policies
- Unencrypted PII storage
- Cross-border data transfer issues
gitleaks -- Secrets
gitleaks finds hardcoded secrets and
credentials: API keys, tokens, private keys, passwords. On a git checkout it
runs gitleaks detect, which also looks through the repository's history; on an
uploaded archive, which has no history, it scans the files with gitleaks dir.
Its findings have the type Zugangsdaten im Code (Secrets); the dashboard
shows the secret shortened.
PLC Control-Logic Analyser
Prüfwerk's own analyser for IEC 61131-3 programs. It parses Structured Text
(.st, .scl, .exp) and PLCopen XML projects, including graphical FBD/LD,
and runs CWE-mapped security rules over them, for example hardcoded credentials,
safety interlock or watchdog bypass, unchecked array indexing and insecure
protocol ports. Its findings have the type SPS-Steuerungslogik. See
SPS / PLC (CODESYS).
LLM-Powered Code Review
For pull-request reviews, Prüfwerk uses an LLM to review the changed code in several passes. A regular scan does not run it, and PR reviews need webhooks, which are not available in this release (see Webhooks & PR Reviews). The review looks for issues too nuanced for static rules, such as:
- Business logic flaws
- Race conditions
- Improper error handling that leaks information
- Insecure design patterns
Code review findings are marked with the Code Review type.
LLM-Powered Triage
Every new finding a scan stores -- regardless of which scanner produced it -- goes through AI triage. Here is how it works:
-
Context gathering -- the triage engine collects the finding details, about 50 lines of surrounding code, and information from the code knowledge graph (what calls this code, what it calls, how it connects to entry points)
-
Severity assessment -- the LLM evaluates the finding considering:
- The vulnerability type and its typical impact
- The specific code context (is this in a test file? behind authentication? in dead code?)
- The blast radius -- how many entry points and call chains are affected, based on the code graph
-
Confidence scoring -- the LLM assigns a confidence from 0 to 10. It is lowered for findings in test, example, generated or vendored files. A finding the LLM dismisses, or does not confirm with a confidence of at least 3, is set to Zu prüfen (needs review); it is never deleted
-
Rationale generation -- the LLM writes a human-readable explanation of why it assigned the severity and confidence it did
-
Remediation guidance -- where it can, the LLM writes a short remediation
::: tip The AI triage is a starting point, not a final verdict. Always review the rationale and code evidence before acting on a finding. See Understanding Findings for more on the human-in-the-loop workflow. :::
Outbound connections (egress)
Every connection the agent opens, in one place. Guarded means: the HTTP client is built with guarded_client_builder (the resolver returns only addresses the net guard approves, every redirect hop is re-checked, no proxy) and the first URL is checked with NetGuard::check_url before it is sent. In a hardened deployment the guard refuses private, loopback, link-local and metadata addresses; PW_ALLOW_PRIVATE_TARGETS=1 relaxes it outside hardened deployments only.
Public data sources
| Destination | What is sent | Module | Guard | Limits | Switch |
|---|---|---|---|---|---|
api.osv.dev (/v1/querybatch, /v1/vulns/{id}) |
purls of SBOM components, advisory ids | pipeline/cve.rs |
guarded | 10 s per request, 5 s connect, body ≤ 16 MiB, 8 advisory reads at once | none (CVE stage) |
services.nvd.nist.gov (/rest/json/cves/2.0) |
CVE ids (CVSS score), CPE product prefixes (CODESYS, embedded libraries) | pipeline/cve.rs, pipeline/nvd_cpe.rs |
guarded | 10 s per request (30 s for a product query), 5 s connect, body ≤ 16 MiB, 3 retries after 6/12/24 s, answers cached 6 h | NVD_API_KEY (optional, raises NVD's rate limit) |
api.nuget.org (registration, catalog) |
NuGet package ids and versions, not for ids a nuget.config routes to another feed |
pipeline/sbom/nuget_license.rs |
guarded | 10 s per request, 5 s connect, body ≤ 2 MiB, 8 at once, 60 s and 300 uncached packages per scan | NUGET_LICENSE_LOOKUP=false |
| Package registries (Go proxy, npm, PyPI, Maven Central) | package names and versions | Syft (pipeline/sbom/syft.rs, remote license lookups) and lockfile generation (npm, cargo, pip-compile in pipeline/sbom/mod.rs) |
not guarded: subprocesses with their own HTTP | Syft 10 min per scan | lockfile generation follows the execution policy |
Tenant-chosen addresses
| Destination | Module | Guard |
|---|---|---|
| Git remotes (clone, fetch, submodules, linked artifacts) | pipeline/git.rs, ingest/ |
check_git_url and the resolved address before every clone and fetch; redirects off |
| Gitea API of a git source or tracker (managed Git) | git_source/gitea.rs, trackers/gitea.rs |
guarded |
| DAST and pentest targets | api/handlers/dast.rs, pentest/orchestrator.rs, compliance-dast |
base URL checked with check_url; the DAST tools share a guarded client |
Operator-configured services (not guarded)
These are set by the operator in the agent's environment, not by a tenant, and often live on the platform's internal network, which the guard refuses by design. They use plain clients.
| Destination | Module | Set by |
|---|---|---|
| LLM gateway (LiteLLM) | llm/ |
LITELLM_URL |
| Tenant registry (entitlements, projects) | registry.rs |
TENANT_REGISTRY_URL |
| breakpilot-compliance OSCAL catalog | controls/oscal_provider.rs |
BREAKPILOT_BASE_URL |
| GitLab and Jira issue trackers | trackers/gitlab.rs, trackers/jira.rs |
GITLAB_URL, JIRA_URL |
| Identity providers for pentest test-user cleanup (Keycloak, Auth0, Okta) | pentest/cleanup.rs |
KEYCLOAK_URL, AUTH0_DOMAIN, OKTA_DOMAIN |
| Headless Chrome for PDF reports | pentest/report/pdf.rs |
CHROME_WS_URL |
| MongoDB | database.rs |
MONGODB_URI |
Planned integrations (decided 2026-08-31, not yet in the code)
The product spec keeps an OSS-only tooling policy and a control-mapping rule of tools detect, the LLM judges. Two deterministic detectors are therefore being added underneath the agentic DAST/pentest layer — the agents stay on top for context-seeded exploitation, chaining and explanation:
| Tool | Role | Status |
|---|---|---|
| Nuclei | Template-driven checks (CVE probes, default credentials, exposed panels, misconfigurations) including ICS/OT templates for WebVisu / OpenPLC / HMI endpoints. Runs as a DAST phase and as a Werkbank job with vendored templates so it works on-prem. | Planned — tracked as an issue |
| OWASP ZAP | Baseline (passive) and, behind the destructive-tests flag, active scan for reproducible spider + rule coverage; results seed the pentest agent. | Planned — follows Nuclei |
Both feed the same control-map lookup table as Semgrep, so their findings receive compliance control_refs through the grounded judge. An offline vulnerability database (Trivy preferred, Grype as alternative) is planned for the on-prem Werkbank runner, which cannot reach the OSV.dev / NVD APIs. Until these land, DAST findings come exclusively from the in-house agents described above.