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
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:
1 parent
0b6c7a46d3
commit
3ad6cc538b
61 files changed
+417
-319
No files matched your search
@@ -22,10 +22,10 @@ Every control lands in one of three buckets, recorded in the `control-map` LUT (
|
||||
| `needs_tooling` | Code-checkable, but no off-the-shelf tool digs it out — we author a detector or use the grounded surface check |
|
||||
| `not_code_checkable` | A design/process property — out of static-scan scope |
|
||||
|
||||
For the **CRA** framework (40 controls) the split is **21 covered · 0 needs_tooling · 19 not_code_checkable**. The originally uncovered controls were resolved as a hybrid:
|
||||
For the **CRA** framework (40 controls) the split is **21 covered · 0 needs_tooling · 19 not_code_checkable**. Every semgrep binding names our own rules only: the Semgrep registry rules are not run (their licence allows internal use only, not a service for others), so a binding covers exactly the languages its rules are written for. The originally uncovered controls were resolved as a hybrid:
|
||||
|
||||
- **Custom semgrep detectors**, shipped in the binary and matched back to controls **by rule id** so a broad CWE can't over-attribute:
|
||||
- for Python and JavaScript/TypeScript: `cra-ai-1`, `7`, `10`, `14` (secure-by-default, weak password hashing, insecure session cookies, weak data-at-rest ciphers);
|
||||
- for Python and JavaScript/TypeScript: `cra-ai-1`, `7`, `10`, `14` (secure-by-default, weak password hashing, insecure session cookies, weak data-at-rest ciphers), `cra-ai-20` (shell commands and SQL built from variables, request input echoed into a response), `cra-ai-8` (hard-coded credentials, Python) and `cra-ai-15` (plain `http://` requests);
|
||||
- for C and C++ firmware: `cra-ai-8`, `13`, `16`, `20` (hard-coded credentials including `#define` macros, broken hash/cipher, `rand()`, unbounded string functions and non-literal format strings), next to cppcheck for memory safety.
|
||||
- **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.
|
||||
|
||||
Reference in new issue
Block a user