v1

latestOpenAPI 3.0.32026-07-22238629559.2 KB
PoliciesService

Update policy

put/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.

Request body

deploymentIdstring int64

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

policyIdstring int64

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

policyMode'MODE_MONITOR' | 'MODE_COMMENT' | 'MODE_BLOCK' | 'MODE_DISABLED' enum

New policy mode to set for the Rule.

  • MODE_MONITOR: Monitor mode, silently report findings
  • MODE_COMMENT: Comment mode, leaves PR comments but does not block
  • MODE_BLOCK: Block mode, leaves PR comments and blocks PR
  • MODE_DISABLED: Disabled mode, not active
valuedescription
MODE_MONITORMonitor mode, silently report findings
MODE_COMMENTComment mode, leaves PR comments but does not block
MODE_BLOCKBlock mode, leaves PR comments and blocks PR
MODE_DISABLEDDisabled mode, not active
rulePathstring

Full path of the Rule.

Response

OK

policyIdstring int64

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

Example response

{
  "policyId": "1",
  "updatedRule": {
    "category": "security",
    "confidence": "CONFIDENCE_HIGH",
    "cweCategories": [
      "CWE-918: Server-Side Request Forgery (SSRF)"
    ],
    "languages": [
      "python"
    ],
    "lastChangeAt": "2024-07-29T22:33:37.380Z",
    "owaspCategories": [
      "A07: Cross-Site Scripting (XSS)"
    ],
    "path": "python.rule.1",
    "policyMode": "MODE_BLOCK",
    "registryMaintainer": "semgrep",
    "rulesets": [],
    "severity": "SEVERITY_HIGH",
    "source": "SOURCE_COMMUNITY",
    "technologies": [
      "django",
      "flask"
    ]
  }
}