security
Semgrep rules for unsafe code, from the FastAPI configuration and your own rule files. Guide: Security.
Selected when
Section titled “Selected when”Always.
Checks
Section titled “Checks”semgrep
Section titled “semgrep”Runs the Semgrep rules of the FastAPI configuration and the files in security.semgrep_rules over the files of the run.
Runs at the push stage, on macOS and Linux.
An injection or a logged secret reads like ordinary code, and a pattern rule finds it before a reviewer has to.
What to do
Section titled “What to do”Change the code the way the message says.
Example
Section titled “Example”A rule in security.semgrep_rules with the pattern eval(...) reports its ID and location at eval(userInput). Parse the input instead, and allow only known operations.
Turn it off
Section titled “Turn it off”gspot ignore security/semgrep --paths "<path>" --reason "<why>"gspot ignore security/semgrep --rule <rule> --reason "<why>"A suppression comment is refused; use gspot ignore.
Settings
Section titled “Settings”| Setting | What it sets |
|---|---|
security.semgrep_rules |
Rule files or folders of the repository that Semgrep runs, along with the rules of the FastAPI configuration. |
Rules for coding agents
Section titled “Rules for coding agents”| Rule file | Installed when |
|---|---|
.gspot/rules/SECURITY.md |
Always |
Tools and versions
Section titled “Tools and versions”| Tool | Version |
|---|---|
| semgrep | 1.181.0 |