List policy rules
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.
Authorizations
Get access to data with your API token. Example header:
Authorization: Bearer 2991e2fb4b540fe75b8f90677b0b892b6314e4961cb001fe6eb452eee248a628
The token can be provisioned from the Tokens section in your Settings, and requires explicitly enabling Web API access.
Path Parameters
Deployment ID (numeric). Example: 123. Can be found at /deployments, or in your Settings in the web UI.
123
Policy ID (numeric). Example: 456. Can be found at /deployments/{deploymentId}/policies.
456
Query Parameters
Cursor to paginate through the rules. Provide a cursor value from the response to retrieve the next page.
Page size to paginate through the rules. The default page size is 500 and the maximum allowed page size is 2000.
Response
OK
Cursor to paginate through the rules.
"Pm0ROjIwMjQtMDItMDYgMjA6MDQ6NDguMEDzNzk2fmk6NYTM2zUxOTI"
List of Rules for the given Policy.
[
{
"category": "security",
"confidence": "CONFIDENCE_HIGH",
"cweCategories": [
"CWE-918: Server-Side Request Forgery (SSRF)"
],
"id": "1",
"languages": ["python"],
"lastChangeAt": "2024-07-29T22:33:37.380293Z",
"owaspCategories": ["A07: Cross-Site Scripting (XSS)"],
"path": "python.rule.1",
"policyMode": "MODE_MONITOR",
"registryMaintainer": "semgrep",
"rulesets": [],
"severity": "SEVERITY_HIGH",
"source": "SOURCE_COMMUNITY",
"technologies": ["django", "flask"],
"url": "https://semgrep.com/r/123/python.rule.1",
"vulnerabilityClass": ["Improper Authentication"]
},
{
"category": "security",
"confidence": "CONFIDENCE_HIGH",
"cweCategories": [
"CWE-918: Server-Side Request Forgery (SSRF)"
],
"id": "2",
"languages": ["python"],
"lastChangeAt": "2024-07-29T22:33:37.380293Z",
"owaspCategories": [
"A01:2021 - Broken Access Control",
"A07: Cross-Site Scripting (XSS)"
],
"path": "python.rule.shared",
"policyMode": "MODE_COMMENT",
"registryMaintainer": "semgrep",
"rulesets": ["comment", "default"],
"severity": "SEVERITY_MEDIUM",
"source": "SOURCE_PRO",
"technologies": ["django", "flask"],
"url": "https://semgrep.com/r/123/python.rule.shared",
"vulnerabilityClass": ["Improper Authentication"]
},
{
"category": "best-practice",
"confidence": "CONFIDENCE_HIGH",
"cweCategories": [],
"id": "3",
"languages": ["python"],
"lastChangeAt": "2024-07-29T22:33:37.380293Z",
"lastChangeBy": "example-user",
"owaspCategories": [],
"path": "python.rule.custom_rule",
"policyMode": "MODE_BLOCK",
"registryMaintainer": "semgrep",
"rulesets": [],
"severity": "SEVERITY_MEDIUM",
"source": "SOURCE_CUSTOM",
"technologies": ["django", "flask"],
"url": "https://semgrep.com/r/123/python.rule.custom_rule",
"vulnerabilityClass": ["Improper Authentication"]
}
]