fix(sast): run only our own semgrep rules, no registry rules or metrics
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 7m10s

The Semgrep registry rules (`--config=auto`, `p/...`) are licensed under the
Semgrep Rules License v1.0: internal business use only, not a service for
others. `auto` also refuses to run with metrics off, so every customer scan
reported to Semgrep. Semgrep now runs only rules/cra_semgrep.yaml, with
--metrics=off and --disable-version-check, and fails the stage if the rules
cannot be staged.

So that Python and JavaScript/TypeScript targets keep their core coverage,
eight rules of our own replace what the registry found in the fixtures:
shell commands and SQL built from variables, unsafe deserialisation,
request input echoed into an Express response (cra-ai-20), hard-coded
credentials in Python (cra-ai-8) and plain http:// requests (cra-ai-15).
Annotated cases live next to the rules (semgrep --test).

The control map's semgrep bindings now list exactly our rule ids and the
languages those rules cover. Before, they claimed Java, Go, Ruby, PHP, C#
and Kotlin on the strength of registry rules, so the CRA view could call
such code free of violations although nothing checked it; it now says
"Keine Prüfregel für den gefundenen Code".

The nightly harness drops `registry_rules`: every semgrep finding is now
deterministic and compared exactly. All baselines reblessed.

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-01 18:09:47 +02:00
1 parent 0b6c7a46d3
commit 3ad6cc538b
61 files changed
+417 -319

No files matched your search

+17 -4
View File
@@ -4,11 +4,24 @@ Prüfwerk uses a combination of open-source scanners and AI-powered analysis to
## Semgrep -- Static Analysis (SAST)
[Semgrep](https://semgrep.dev/) is an open-source static analysis tool that finds vulnerabilities by matching patterns in source code. It supports many languages and has an extensive rule library.
[Semgrep](https://semgrep.dev/) is an open-source static analysis engine (LGPL-2.1) that finds vulnerabilities by matching patterns in source code.
Prüfwerk runs Semgrep with its public `auto` ruleset plus its own CRA rules
for controls no off-the-shelf rule covers (secure defaults, weak password
hashing, insecure session cookies, weak ciphers for data at rest).
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.