Skip to main content

Update CI Serverless Vulnerability Policy

PUT 

/api/v33.02/policies/vulnerability/ci/serverless

x-prisma-cloud-target-env: {"permission":"policyServerless"}

Updates the vulnerability policy for serverless functions scanned in your continuous integration (CI) pipeline. All rules in the policy are updated in a single shot.

The policy set in this endpoint is enforced by the scanners in the Jenkins plugin and the twistcli command line tool.

This endpoint maps to the policy table in Defend > Vulnerabilities > Functions > CI 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 'https://<CONSOLE>/api/v<VERSION>/policies/vulnerability/ci/serverless' \
-X PUT \
-u <USER> \
-H 'Content-Type: application/json' \
-d \
'{
"rules": [
{
"name": "<RULE_NAME>",
"collections": [
{
"name":"<COLLECTION_NAME>",
}
],
"alertThreshold": {
"value": 1,
"disabled": false
},
"blockThreshold": {
"value": 0,
"enabled": false
},

...

}
],
"policyType": "ciServerlessVulnerability",

...

}'

Note: No response will be returned upon successful execution.

Request

Responses

OK