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
@@ -119,14 +119,6 @@
|
||||
"scan_type": "sast",
|
||||
"languages": [
|
||||
"python",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"java",
|
||||
"go",
|
||||
"ruby",
|
||||
"php",
|
||||
"csharp",
|
||||
"kotlin",
|
||||
"c",
|
||||
"cpp"
|
||||
],
|
||||
@@ -135,6 +127,7 @@
|
||||
"CWE-259"
|
||||
],
|
||||
"rules": [
|
||||
"cra-ai-8-python-hardcoded-credential",
|
||||
"cra-ai-8-c-hardcoded-credential"
|
||||
],
|
||||
"check": "No credential (password, key, token) may be written into the product's source, as a variable or a #define: every device would ship the same secret. A placeholder or an empty value does not violate it."
|
||||
@@ -154,27 +147,6 @@
|
||||
"cwe": [],
|
||||
"rules": [],
|
||||
"check": "Credentials must not be kept in plain text in the source or configuration; a real secret committed to the repository violates it."
|
||||
},
|
||||
{
|
||||
"tool": "semgrep",
|
||||
"scan_type": "sast",
|
||||
"languages": [
|
||||
"python",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"java",
|
||||
"go",
|
||||
"ruby",
|
||||
"php",
|
||||
"csharp",
|
||||
"kotlin"
|
||||
],
|
||||
"cwe": [
|
||||
"CWE-798",
|
||||
"CWE-522"
|
||||
],
|
||||
"rules": [],
|
||||
"check": "Credentials must not be kept or compared in plain text; a hard-coded or plain-text stored secret violates it."
|
||||
}
|
||||
],
|
||||
"note": null,
|
||||
@@ -267,15 +239,6 @@
|
||||
"tool": "semgrep",
|
||||
"scan_type": "sast",
|
||||
"languages": [
|
||||
"python",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"java",
|
||||
"go",
|
||||
"ruby",
|
||||
"php",
|
||||
"csharp",
|
||||
"kotlin",
|
||||
"c",
|
||||
"cpp"
|
||||
],
|
||||
@@ -325,19 +288,13 @@
|
||||
"languages": [
|
||||
"python",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"java",
|
||||
"go",
|
||||
"ruby",
|
||||
"php",
|
||||
"csharp",
|
||||
"kotlin"
|
||||
"typescript"
|
||||
],
|
||||
"cwe": [
|
||||
"CWE-319",
|
||||
"CWE-311"
|
||||
"cwe": [],
|
||||
"rules": [
|
||||
"cra-ai-15-python-cleartext-http",
|
||||
"cra-ai-15-node-cleartext-http"
|
||||
],
|
||||
"rules": [],
|
||||
"check": "Network traffic must use TLS 1.2 or newer with certificate checking; plain HTTP for sensitive data, disabled verification or old protocol versions violate it."
|
||||
}
|
||||
],
|
||||
@@ -360,15 +317,6 @@
|
||||
"tool": "semgrep",
|
||||
"scan_type": "sast",
|
||||
"languages": [
|
||||
"python",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"java",
|
||||
"go",
|
||||
"ruby",
|
||||
"php",
|
||||
"csharp",
|
||||
"kotlin",
|
||||
"c",
|
||||
"cpp"
|
||||
],
|
||||
@@ -417,12 +365,6 @@
|
||||
"python",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"java",
|
||||
"go",
|
||||
"ruby",
|
||||
"php",
|
||||
"csharp",
|
||||
"kotlin",
|
||||
"c",
|
||||
"cpp"
|
||||
],
|
||||
@@ -433,11 +375,16 @@
|
||||
"CWE-22"
|
||||
],
|
||||
"rules": [
|
||||
"cra-ai-20-python-shell-command",
|
||||
"cra-ai-20-python-sql-string",
|
||||
"cra-ai-20-python-unsafe-deserialization",
|
||||
"cra-ai-20-node-shell-command",
|
||||
"cra-ai-20-node-reflected-input",
|
||||
"cra-ai-20-c-unbounded-string-function",
|
||||
"cra-ai-20-c-scanf-unbounded-string",
|
||||
"cra-ai-20-c-non-literal-format-string"
|
||||
],
|
||||
"check": "The code must not write past a buffer or let input control a format string: strcpy, strcat, sprintf, gets, scanf(\"%s\") or a non-literal format argument violates it."
|
||||
"check": "Untrusted input must not reach a shell, an SQL statement or an HTML response unencoded, and the code must not write past a buffer or let input control a format string: a command or query built from a variable, request input echoed into a response, strcpy, strcat, sprintf, gets, scanf(\"%s\") or a non-literal format argument violates it."
|
||||
},
|
||||
{
|
||||
"tool": "cppcheck",
|
||||
|
||||
Reference in new issue
Block a user