v1

latestOpenAPI 3.0.32026-07-22238629559.2 KB
PoliciesService

List policy rules

get/api/v1/deployments/{deploymentId}/policies/{policyId}

Path parameters

deploymentIdstring int64 required

Deployment ID (numeric). Example: 123. Can be found at /deployments, or in your Settings in the web UI.

policyIdstring int64 required

Policy ID (numeric). Example: 456. Can be found at /deployments/{deploymentId}/policies.

Query parameters

cursorstring

Cursor to paginate through the rules. Provide a cursor value from the response to retrieve the next page.

limitinteger

Page size to paginate through the rules. The default page size is 500 and the maximum allowed page size is 2000.

Response

OK

cursorstring

Cursor to paginate through the rules.

Example response

{
  "cursor": "Pm0ROjIwMjQtMDItMDYgMjA6MDQ6NDguMEDzNzk2fmk6NYTM2zUxOTI",
  "policy": {
    "id": "1",
    "isDefault": true,
    "name": "Global Policy",
    "productType": "PRODUCT_TYPE_SAST",
    "slug": "global_policy"
  },
  "rules": [
    {
      "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"
      ]
    }
  ]
}