All Projects → returntocorp → Semgrep Rules

returntocorp / Semgrep Rules

Licence: other
Semgrep rules registry

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Semgrep Rules

Nodejsscan
nodejsscan is a static security code scanner for Node.js applications.
Stars: ✭ 1,874 (+1238.57%)
Mutual labels:  static-analysis, security-scanner
Salus
Security scanner coordinator
Stars: ✭ 441 (+215%)
Mutual labels:  static-analysis, security-scanner
Cwe checker
cwe_checker finds vulnerable patterns in binary executables
Stars: ✭ 372 (+165.71%)
Mutual labels:  security-scanner, program-analysis
Krane
Kubernetes RBAC static Analysis & visualisation tool
Stars: ✭ 254 (+81.43%)
Mutual labels:  static-analysis, security-scanner
Pest
🐞 Primitive Erlang Security Tool
Stars: ✭ 79 (-43.57%)
Mutual labels:  static-analysis, security-scanner
Seahorn
SeaHorn Verification Framework
Stars: ✭ 270 (+92.86%)
Mutual labels:  static-analysis, program-analysis
Wala
T.J. Watson Libraries for Analysis
Stars: ✭ 395 (+182.14%)
Mutual labels:  static-analysis, program-analysis
iec-checker
Static analysis of IEC 61131-3 programs
Stars: ✭ 36 (-74.29%)
Mutual labels:  static-analysis, program-analysis
Pyre Check
Performant type-checking for python.
Stars: ✭ 5,716 (+3982.86%)
Mutual labels:  static-analysis, program-analysis
Jsprime
a javascript static security analysis tool
Stars: ✭ 556 (+297.14%)
Mutual labels:  static-analysis, security-scanner
progge.rs
Program analysis playground for a simple, imperative language
Stars: ✭ 29 (-79.29%)
Mutual labels:  static-analysis, program-analysis
Crab
CoRnucopia of ABstractions: a library for building abstract interpretation-based analyses
Stars: ✭ 102 (-27.14%)
Mutual labels:  static-analysis, program-analysis
clam
Static Analyzer for LLVM bitcode based on Abstract Interpretation
Stars: ✭ 180 (+28.57%)
Mutual labels:  static-analysis, program-analysis
Linter
Static Analysis Compiler Plugin for Scala
Stars: ✭ 273 (+95%)
Mutual labels:  static-analysis, program-analysis
tiro
TIRO - A hybrid iterative deobfuscation framework for Android applications
Stars: ✭ 20 (-85.71%)
Mutual labels:  static-analysis, program-analysis
Applicationinspector
A source code analyzer built for surfacing features of interest and other characteristics to answer the question 'What's in the code?' quickly using static analysis with a json based rules engine. Ideal for scanning components before use or detecting feature level changes.
Stars: ✭ 3,873 (+2666.43%)
Mutual labels:  static-analysis, security-scanner
Codeql Go
The CodeQL extractor and libraries for Go.
Stars: ✭ 224 (+60%)
Mutual labels:  static-analysis, program-analysis
Dg
[LLVM Static Slicer] Various program analyses, construction of dependence graphs and program slicing of LLVM bitcode.
Stars: ✭ 242 (+72.86%)
Mutual labels:  static-analysis, program-analysis
Phasar
A LLVM-based static analysis framework.
Stars: ✭ 503 (+259.29%)
Mutual labels:  static-analysis, program-analysis
Ikos
Static analyzer for C/C++ based on the theory of Abstract Interpretation.
Stars: ✭ 1,368 (+877.14%)
Mutual labels:  static-analysis, program-analysis

semgrep-rules

powered by semgrep r2c community slack

branch using semgrep docker image test status
master returntocorp/semgrep:latest semgrep-rules-test
develop returntocorp/semgrep:develop semgrep-rules-test-develop

Welcome! This repository is the “standard library” for Semgrep rules, but there are many more written by r2c and other contributors available in the Semgrep Registry.

How do I use these rules?

We recommend starting with a pre-selected subset of rules that someone has already carefully tuned for precision. These rulesets, which may include rules not present in this repository, are available for free on the Semgrep Registry.

The two most popular rulesets are:

  • semgrep --config=p/ci to find logic bugs and high-confidence security vulnerabilities; recommended for CI
  • semgrep --config=p/security-audit to find security audit points; noisy, recommended for manual scans

If you are determined to drink from the firehose, you can also pull directly from the registry by specifying r/<foldername.subfolder.etc>. So to run all the Python Flask rules from the python/flask directory in this repo, just run:
semgrep --config=r/python.flask

Semgrep releases new versions very frequently and the rules in this repo are always updated to take advantage of new features or fix breaking changes on new releases. For that reason, we suggest that you avoid stale copies of registry rules.

Contributing

If you want to create your own collection of Semgrep rules, feel free to make your own repository and then make a PR adding it to the list of repositories with Semgrep rules. This list automatically gets pulled into the Semgrep Registry so that lots of Semgrep users can find your rules!

We also welcome rule contributions directly to this repository! Since this repo is maintained by r2c, there are some extra benefits—for example, if there are bug reports for your rule, we’ll also take responsibility to help fix it. If you are submitting to the semgrep-rules repo (rather than your own, separate repository as mentioned above) we’ll ask you to make r2c a joint owner of your contributions. While you still own copyright rights to your rule, joint ownership allows r2c to license these contributions to other Semgrep Registry users pursuant to the LGPL 2.1 under the Commons Clause. Check out the Contributing Guidelines to get started.

If you have more questions, please see the FAQ section in the Semgrep docs.

Help

Join Slack for the fastest answers to your questions! Or contact the team at [email protected].

Security Coverage

semgrep features security rules that target common weaknesses and OWASP categories. Each security rule in this repository has metadata fields for cwe (and owasp when applicable).

Rule Namespacing

The namespacing format for contributing rules is <language>.<framework>.<category>.$MORE. If a framework isn't applicable, use lang instead.

category is one of:

  • security
  • correctness
  • best-practice
  • maintainability
  • performance

If a security rule is discouraging the use of a bad pattern (such as formatted SQL strings), it is recommended to append audit to your namespace. This distinguishes it from a security rule that is specifically aiming to detect a vulnerability.

semgrep.live rule namespace

Github Action To Run Tests

If you fork this repo or create your own, you can add a special semgrep-rules-test Github Action to your workflow that will automatically test your rules by running make test using the latest version of semgrep.

See ours here

Benchmarks

The benchmark job runs every weekend. It uploads a few artifacts, which can be downloaded. If you download the test logs, there are two relevant pieces of information in there: the benchmark table, which roughly shows the performance of every rule that completes in under 60 seconds, and any failed tests are rules that did not complete within 60 seconds.

To run benchmark tests locally, do the following from the root of semgrep-rules:

pipenv shell
pipenv install --dev
export PYTHONPATH=.
pytest --timeout=60 --rule-directory=[path_to_rule_directory] --git-repo=[git_URL] tests/performance/test_public_repos.py

If you omit --git-repo from the pytest command, it will run the provided benchmark repo.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].