Update Code Repository Vulnerability Policy
PUT/api/v31.02/policies/vulnerability/coderepos
x-prisma-cloud-target-env: {"permission":"policyCodeRepos","saas":true,"self-hosted":true}
x-public: true
Updates the vulnerability policy for your code repositories. All rules in the policy are updated in a single shot.
This endpoint maps to the policy table in Defend > Vulnerabilities > Code repositories in the Console UI.
cURL Request
Refer to the following example cURL command that overwrites all rules in your current policy with a new policy that has a single rule:
$ curl -k \
-u <USER> \
-H 'Content-Type: application/json' \
-X PUT 'https://<CONSOLE>/api/v<VERSION>/policies/vulnerability/coderepos' \
--data '
{
"rules":[
{
"name":"<RULE_NAME>",
"collections":[
{
"name":"<COLLECTION_NAME>",
}
],
"alertThreshold":{
"disabled":false,
"value":0
},
"blockThreshold":{
"enabled":false,
"value":0
},
...
}
],
"policyType": "codeRepoVulnerability"
...
}'
Note: No response will be returned upon successful execution.
Request
Responses
- 200
- default
OK