Documentation Index
Fetch the complete documentation index at: https://docs.semgrep.dev/llms.txt
Use this file to discover all available pages before exploring further.
General
How are Semgrep and its rules licensed?
How are Semgrep and its rules licensed?
Semgrep Community Edition (CE)
Semgrep CE is a free, community-supported code scanning tool. It’s perfect for individuals, security auditors, and penetration testers who need fast, one-off scans. You can use it at work, on private and proprietary code, no problem!Semgrep CE includes:- The Semgrep open source engine: Governed by the LGPL 2.1 license
- Semgrep-maintained Rules: Governed by the Semgrep Rules License v. 1.0
- Semgrep Code, a static application security testing (SAST) tool that can perform taint, cross-file, and cross-function analysis.
- Semgrep Supply Chain, which performs dependency scanning.
- Semgrep Secrets, which can detect and validate leaked secrets in code.
Semgrep Rules
All Semgrep maintained rules are licensed under the Semgrep Rules License v. 1.0. The source for these rules is available at thesemgrep/semgrep-rules repository.These rules can only be used for internal business purposes. These rules cannot be resold without permission from Semgrep, Inc. (“Semgrep”). Since Semgrep offers a paid, hosted application, it’s important to have this restriction so other companies cannot resell Semgrep’s rules as a competing service.Is it OK to run Semgrep or Semgrep, Inc. rules on my work projects?
Is it OK to run Semgrep or Semgrep, Inc. rules on my work projects?
How does the `semgrep/semgrep-rules` repository differ from the Semgrep Registry?
How does the `semgrep/semgrep-rules` repository differ from the Semgrep Registry?
semgrep/semgrep-rules repository, such as Trail of Bits. These rules have their own licenses.I’m a security professional. Do I have to pay for Semgrep?
I’m a security professional. Do I have to pay for Semgrep?
Can I ship my own code analysis software that uses Semgrep CE?
Can I ship my own code analysis software that uses Semgrep CE?
Contacting Semgrep support
Contacting Semgrep support
Embedding the Playground in my website or blog post
Embedding the Playground in my website or blog post
iframe. The source is https://semgrep.dev/embed/editor?snippet=<snippet-id> where the snippet-id is either the short identifier generated when you share a Playground link (this usually looks like DzKv) or the named identifier from a saved rule (this usually looks like username:rule-name).How does Semgrep go "beyond regex"?
How does Semgrep go "beyond regex"?
grep "2" only matches the exact string 2, Semgrep matches other equivalent forms, such as x = 1; y = x + 1 when searching for 2. Semgrep’s pattern syntax provides specific mechanisms to fine-tune matches, such as the ellipsis operator and metavariables.See the following rule for a more complex example illustrating Semgrep features:- It uses typed metavariables so it can specify the type
http.Request. - In the sink, the rule tracks imports down to function usage.
- In the sanitizer, it removes type aware Booleans and a string convert function.
- It leverages regex only to reduce how many patterns to write for finding dangerous functions.
Does Semgrep support all versions of a language?
Does Semgrep support all versions of a language?
Comparisons
How is Semgrep different from $OTHER_TOOL or $GENERIC_SAST?
How is Semgrep different from $OTHER_TOOL or $GENERIC_SAST?
Besides the ease of writing new rules, what else is different about Semgrep?
Besides the ease of writing new rules, what else is different about Semgrep?
Speedy and offline: Semgrep runs offline on every keystroke
If you are shipping code daily a code analysis tool that takes a week to run is not helpful. We think modern static analysis tools should run on every keystroke in the editor, without needing network access. Semgrep runs at approximately 20K-100K loc/sec per rule but our goal is to be even faster.Semantic: Semgrep is smart
Semgrep automatically handles the nuance of “there’s more than one way to do it”: you write your query and all equivalent variations of that code are automatically matched.As Semgrep evolves, queries similar tofoo("password") become smarter. In the original version of Semgrep, this query would only match the code foo("password"). But a few months after release Semgrep would match const x = "password"; foo(x).Today Semgrep can do even more with intraprocedural dataflow analysis, and we’re working on adding more of these semantic features with every release.Integrated: Semgrep understands Git
It’s easy to write a new Semgrep rule and have it only apply going forward. You can ignore findings of course, but we have built-in support for this with Semgrep AppSec Platform and various repository integrations.Portable: If you write a Semgrep rule, it runs anywhere
Many other tools require a buildable environment or can only be run in a VM. Semgrep runs “on the metal” and has minimal dependencies around a statically linked core; our parsers are declaratively generated C libraries (we contribute to and use tree-sitter).See the Semgrep philosophy for further reading.Comparing Semgrep to linters
Comparing Semgrep to linters
Comparing Semgrep to other security tools
Comparing Semgrep to other security tools
Privacy and Security
Where do you store data?
Where do you store data?
How is data secured, including data-at-rest and data-in-transit?
How is data secured, including data-at-rest and data-in-transit?
Is private source code shared with Semgrep, Inc?
Is private source code shared with Semgrep, Inc?
What data is stored?
What data is stored?
- Scan data includes project name, CI environment, and scan meta-data.
- Findings data are used to provide human-readable content for notifications and integrations, as well as tracking results as new, fixed, or duplicate.
What network requests are made?
What network requests are made?
- When running without
--disable-version-check, Semgrep makes a network request to check for updates. - When providing a URL to
--output, Semgrep performs an HTTPPOSTof the results to the specified URL. - When providing a registry ID like
p/cito--config, Semgrep requests the configuration from the Registry and may send metrics in accordance with the metrics policy.
Configuration
How do I configure Semgrep for different projects?
How do I configure Semgrep for different projects?
What is a policy?
What is a policy?
Monitoring
Do you have a visualization UI?
Do you have a visualization UI?
Privacy
How long does Semgrep retain findings data?
How long does Semgrep retain findings data?