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.
Prerequisites
- An understanding of secure guardrails.
- Knowledge of the basic Semgrep rule structure is helpful. See Rule syntax and Pattern syntax documentation.
- Enabling Code search (beta) is useful in verifying that your rule matches what you want it to match within your repositories.
General steps
The following table lists the relevant documentation for each step:
| Steps | References and notes |
|---|---|
| Create a custom rule | In addition to the required fields of a Semgrep rule, the following metadata fields are useful:
confidence and impact in particular is useful for filtering rules within the Semgrep web app.Read the metadata reference documentation. |
| Verify that the rule matches as intended |
|
| Optional: Set the rule as a secure default | When creating a custom secure default, you must use category: security and subcategory: secure default values in your rule (see Secure default snippet). |
| Deploy the rule as a guardrail | For PR or MR comments: For IDEs: Require developers to install the Semgrep extension for their IDE. For |
Secure default snippet
When creating a custom secure default, you must usecategory: security and subcategory: secure default values in your rule: