Skip to main content

20 docs tagged with "Rule writing"

View all tags

Autofix

Learn how to use Semgrep rules' autofix key to provide suggested fixes for matched patterns through pull request or merge request comments.

Constant propagation

Semgrep performs flow-sensitive constant folding, and this information is used by the matching engine.

Generic pattern matching

Semgrep can match generic patterns in languages that it doesn’t support yet. You can use generic pattern matching for languages that do **not** have a parser, configuration files, or other structured data such as XML.

Glossary

Definitions of static analysis and Semgrep rule-writing terms.

Metavariable analysis

metavariable-analysis allows Semgrep users to check metavariables for common problematic properties, such as RegEx denial of service (ReDoS) and high-entropy values.

Overview

Learn how to use Semgrep’s intuitive syntax to write rules specific to your codebase. You can write and share rules directly from your browser using the Semgrep Editor, or you can write rules in your terminal and run them on the command line.

Private rules

Semgrep Code users can publish rules to the Semgrep Registry that are not visible to others outside their organization. This can be useful for organizations where rules may contain code-sensitive information or legal requirements prevent using a public registry.

Rule structure syntax

This document describes the YAML rule syntax of Semgrep, including required and optional fields.

Semantic detection in Java

Proprietary Semgrep features for the Java language that can increase true positives and reduce false positives.

Semgrep trophy case

This is a list of vulnerabilities found and security fixes made with Semgrep.

Taint analysis

Taint mode allows you to write simple rules that catch complex injection bugs thanks to taint analysis.

Test rules

Semgrep provides a testing mechanism for your rules. You can write code and provide annotations to let Semgrep know where you are or aren't expecting findings.

Troubleshooting rules

Follow these troubleshooting steps when your pattern fails to parse, your rule doesn't match its intended code, and other rule writing pitfalls.