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
95 lines
14 KiB
Plaintext
95 lines
14 KiB
Plaintext
elttam semgrep-rules
|
|
====================
|
|
|
|
Upstream: https://github.com/elttam/semgrep-rules
|
|
Commit: 244268562cc92d33f54b8a60a187df5520f91b26
|
|
Version: main (2026-08-03, no tags)
|
|
Licence: MIT (LICENSE names 'Copyright (c) 2020 Semgrep': the MIT text of the repository template the first commit came from)
|
|
Copyright: Copyright (c) 2020 Semgrep; rules by elttam
|
|
|
|
Prüfwerk runs these rules with its own semgrep invocation (--metrics=off,
|
|
local files only). upstream/ holds the selected files unchanged, with
|
|
their semgrep tests. pack.yaml is what the agent runs: the same rules with
|
|
ids prefixed by 'elttam-', re-serialised into one file, without
|
|
the rules listed below. Both are produced by scripts/vendor-semgrep-rules.py.
|
|
|
|
Selected from upstream: rules/generic/**, rules/go/**, rules/java/**, rules/php/**, rules/yaml/**, rules-audit/**
|
|
Rules in the pack: 34 (from 24 files)
|
|
|
|
Left out
|
|
--------
|
|
|
|
- elttam-UnsafeHttpInvokerServiceExporter-extends (rules/java/spring/security/audit/remoting/UnsafeHttpInvokerServiceExporter.yml): one of its rules does not parse in semgrep 1.177, which fails the file's test; not vendored (the XML variant is)
|
|
- elttam-UnsafeHttpInvokerServiceExporter-func (rules/java/spring/security/audit/remoting/UnsafeHttpInvokerServiceExporter.yml): one of its rules does not parse in semgrep 1.177, which fails the file's test; not vendored (the XML variant is)
|
|
- elttam-UnsafeHttpInvokerServiceExporter-var (rules/java/spring/security/audit/remoting/UnsafeHttpInvokerServiceExporter.yml): one of its rules does not parse in semgrep 1.177, which fails the file's test; not vendored (the XML variant is)
|
|
- elttam-allow-privilege-escalation (rules/yaml/kubernetes/security/allow-privilege-escalation.yaml): derived from Semgrep registry rules (same paths and wording, 'Upstream PR 2630'); not vendored
|
|
- elttam-aspnet-controller-entrypoint (rules-audit/csharp/dotnet/security/audit/entrypoints/aspnet-controller.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-beego-ormleak-dynamic-expr-review (rules-audit/go/orm-leak/beego-orm.yaml): ORM-leak review hints whose upstream tests name rules that do not exist (`semgrep --test` fails); not vendored
|
|
- elttam-beego-ormleak-dynamic-orderby-review (rules-audit/go/orm-leak/beego-orm.yaml): ORM-leak review hints whose upstream tests name rules that do not exist (`semgrep --test` fails); not vendored
|
|
- elttam-beego-ormleak-filterraw (rules-audit/go/orm-leak/beego-orm.yaml): ORM-leak review hints whose upstream tests name rules that do not exist (`semgrep --test` fails); not vendored
|
|
- elttam-beego-ormleak-taint-dynamic-expr (rules-audit/go/orm-leak/beego-orm.yaml): ORM-leak review hints whose upstream tests name rules that do not exist (`semgrep --test` fails); not vendored
|
|
- elttam-class-extends-action-support (rules-audit/java/struts2/security/audit/entrypoints/action-support.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-consumes-class-star (rules-audit/java/jax-rs/security/audit/entrypoints/consumes-class-star.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-consumes-method-star (rules-audit/java/jax-rs/security/audit/entrypoints/consumes-method-star.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-convention-annotation-class (rules-audit/java/struts2/security/audit/entrypoints/convention-annotation-class.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-convention-annotation-class-method (rules-audit/java/struts2/security/audit/entrypoints/convention-annotation-class-method.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-convention-annotation-package-info (rules-audit/java/struts2/security/audit/entrypoints/convention-annotation-package-info.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-django-filter-exposes-all-fields (rules-audit/python/orm-leak/django-orm.yaml): ORM-leak review hints whose upstream tests name rules that do not exist (`semgrep --test` fails); not vendored
|
|
- elttam-django-orm-dynamic-lookup-kwargs (rules-audit/python/orm-leak/django-orm.yaml): ORM-leak review hints whose upstream tests name rules that do not exist (`semgrep --test` fails); not vendored
|
|
- elttam-django-orm-dynamic-lookup-variable-key (rules-audit/python/orm-leak/django-orm.yaml): ORM-leak review hints whose upstream tests name rules that do not exist (`semgrep --test` fails); not vendored
|
|
- elttam-django-orm-dynamic-orderby-or-values (rules-audit/python/orm-leak/django-orm.yaml): ORM-leak review hints whose upstream tests name rules that do not exist (`semgrep --test` fails); not vendored
|
|
- elttam-ef-ormleak-dynamic-orderby (rules-audit/csharp/dotnet/orm-leak/entity-framework-orm.yaml): ORM-leak review hints whose upstream tests name rules that do not exist (`semgrep --test` fails); not vendored
|
|
- elttam-ef-ormleak-dynamic-where (rules-audit/csharp/dotnet/orm-leak/entity-framework-orm.yaml): ORM-leak review hints whose upstream tests name rules that do not exist (`semgrep --test` fails); not vendored
|
|
- elttam-ef-ormleak-taint-dynamic-include (rules-audit/csharp/dotnet/orm-leak/entity-framework-orm.yaml): ORM-leak review hints whose upstream tests name rules that do not exist (`semgrep --test` fails); not vendored
|
|
- elttam-ef-ormleak-taint-property (rules-audit/csharp/dotnet/orm-leak/entity-framework-orm.yaml): ORM-leak review hints whose upstream tests name rules that do not exist (`semgrep --test` fails); not vendored
|
|
- elttam-exec (rules-audit/c/lang/security/audit/exec.yaml): enumerates every process start for a manual audit, not a weakness; not vendored
|
|
- elttam-execute-method (rules-audit/java/struts2/security/audit/entrypoints/execute-method.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-express-app-router-handler (rules-audit/javascript/express/security/audit/entrypoints/app-router-handler.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-flask-app-route-handler (rules-audit/python/flask/security/audit/entrypoints/app-route-handler.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-http-method-class-path (rules-audit/java/jax-rs/security/audit/entrypoints/method-path.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-http-method-method-path (rules-audit/java/jax-rs/security/audit/entrypoints/method-path.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-http-method-no-path (rules-audit/java/jax-rs/security/audit/entrypoints/method-path.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-http-method-path-path (rules-audit/java/jax-rs/security/audit/entrypoints/method-path.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-java-servlet-filter (rules-audit/java/spring/security/audit/entrypoints/java-servlet-filter.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-jax-rs-httpmethod (rules-audit/java/jax-rs/security/audit/entrypoints/httpmethod.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-jax-rs-path-class (rules-audit/java/jax-rs/security/audit/entrypoints/path-class-string.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-jax-rs-path-expression (rules-audit/java/jax-rs/security/audit/entrypoints/jax-rs.path-expression.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-jsp-likely-xss (rules/generic/jsp-likely-xss.yaml): a `mode: join` rule (experimental semgrep join mode, no single-file semantics); not vendored
|
|
- elttam-network-policy-ingress-any (rules/yaml/kubernetes/audit/network-policy-ingress-any.yaml): derived from Semgrep registry rules (same paths and wording, 'Upstream PR 2630'); not vendored
|
|
- elttam-no-security-context (rules/yaml/kubernetes/security/no-security-context.yaml): derived from Semgrep registry rules (same paths and wording, 'Upstream PR 2630'); not vendored
|
|
- elttam-path-class (rules-audit/java/jax-rs/security/audit/entrypoints/path-class.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-path-class-method (rules-audit/java/jax-rs/security/audit/entrypoints/path-class-method.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-path-method-string (rules-audit/java/jax-rs/security/audit/entrypoints/path-class-method-string.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-php-filter-chain-read-from-oracle (rules/php/php-filter-chain-read-from-oracle.yml): fails its own upstream test in semgrep 1.177 (a false positive on a line marked ok); not vendored
|
|
- elttam-prisma-orm-operator-injection (rules-audit/javascript/orm-leak/prisma-orm.yaml): ORM-leak review hints whose upstream tests name rules that do not exist (`semgrep --test` fails); not vendored
|
|
- elttam-prisma-ormleak-taint-orderby (rules-audit/javascript/orm-leak/prisma-orm.yaml): ORM-leak review hints whose upstream tests name rules that do not exist (`semgrep --test` fails); not vendored
|
|
- elttam-prisma-ormleak-taint-projection (rules-audit/javascript/orm-leak/prisma-orm.yaml): ORM-leak review hints whose upstream tests name rules that do not exist (`semgrep --test` fails); not vendored
|
|
- elttam-prisma-ormleak-taint-where (rules-audit/javascript/orm-leak/prisma-orm.yaml): ORM-leak review hints whose upstream tests name rules that do not exist (`semgrep --test` fails); not vendored
|
|
- elttam-privileged-container (rules/yaml/kubernetes/audit/privileged-container.yaml): derived from Semgrep registry rules (same paths and wording, 'Upstream PR 2630'); not vendored
|
|
- elttam-processbuilder (rules-audit/java/lang/security/audit/processbuilder.yml): enumerates every ProcessBuilder for a manual audit, not a weakness; not vendored
|
|
- elttam-provider-class (rules-audit/java/jax-rs/security/audit/entrypoints/provider.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-rand-token-insecure-rng (rules-audit/javascript/rand-token.yml): fails its own upstream test in semgrep 1.177 (misses a line marked ruleid); not vendored
|
|
- elttam-rest-CrossOrigin (rules-audit/java/spring/security/audit/entrypoints/crossorigin.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-rest-DeleteMapping (rules-audit/java/spring/security/audit/entrypoints/deletemapping.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-rest-GetMapping (rules-audit/java/spring/security/audit/entrypoints/getmapping.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-rest-Order (rules-audit/java/spring/security/audit/entrypoints/order.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-rest-PatchMapping (rules-audit/java/spring/security/audit/entrypoints/patchmapping.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-rest-PostMapping (rules-audit/java/spring/security/audit/entrypoints/postmapping.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-rest-Priority (rules-audit/java/spring/security/audit/entrypoints/priority.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-rest-PutMapping (rules-audit/java/spring/security/audit/entrypoints/putmapping.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-rest-RequestMapping (rules-audit/java/spring/security/audit/entrypoints/requestmapping.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-rest-ResponseBody (rules-audit/java/spring/security/audit/entrypoints/responsebody.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-rest-RestController (rules-audit/java/spring/security/audit/entrypoints/restcontroller.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-rest-servletregistrationbean (rules-audit/java/spring/security/audit/entrypoints/servletregistrationbean.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-run-as-non-root (rules/yaml/kubernetes/security/run-as-non-root.yaml): derived from Semgrep registry rules (same paths and wording, 'Upstream PR 2630'); not vendored
|
|
- elttam-run-as-non-root-unsafe-value (rules/yaml/kubernetes/security/run-as-non-root-unsafe-value.yaml): derived from Semgrep registry rules (same paths and wording, 'Upstream PR 2630'); not vendored
|
|
- elttam-save-state (rules/yaml/github-actions/security/save-state.yaml): CI workflow hygiene, not product code; not vendored
|
|
- elttam-set-output (rules/yaml/github-actions/security/set-output.yaml): CI workflow hygiene, not product code; not vendored
|
|
- elttam-spark-route-handler (rules-audit/kotlin/spark/security/audit/entrypoints/route-handler.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-struts-xml-action-name (rules-audit/java/struts2/security/audit/entrypoints/struts-xml-action-name.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-taglib-action (rules-audit/java/struts2/security/audit/entrypoints/taglib-action.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-taglib-directive (rules-audit/java/struts2/security/audit/entrypoints/taglib-directive.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-web-xml (rules-audit/java/struts2/security/audit/entrypoints/web-xml.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-web-xml-filter-url-pattern (rules-audit/java/struts2/security/audit/entrypoints/web-xml-filter-url-pattern.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|
|
- elttam-web-xml-listener (rules-audit/java/struts2/security/audit/entrypoints/web-xml-listener.yml): enumerates every controller/route for a manual audit, not a weakness; not vendored
|