Update Custom Compliance Checks
PUT/api/v33.00/custom-compliance
x-prisma-cloud-target-env: {"permission":"policyComplianceCustomRules"}
This endpoint will allow for update of the custom compliance checks.
This endpoint maps to Defend > Compliance > Custom in the Console UI.
cURL Request
Create custom_check.json
file (example):
{
"modified": "2019-03-07T17:01:12.355Z",
"owner": "pierre",
"name": "apitest",
"previousName": "",
"_id": 9000,
"title": "apitest",
"script": "if [ $(stat -c %a /bin/busybox) -eq 755 ]; then\n echo 'test permission failure' && exit 1;\nfi",
"severity": "high"
}
Refer to the following example curl command that uses basic auth to update the checks:
$ curl -k \
-u <USER> \
-H 'Content-Type: application/json' \
-X PUT \
-d @custom_check.json \
https://<CONSOLE>/api/v<VERSION>/custom-compliance
Request
- application/json
Body
ID is the compliance check ID.
Indicates whether the rule is currently disabled. Values: true (disabled) or false (enabled).
Specifies the date and time when the rule was last modified.
Name of the rule.
Describes any noteworthy points for a rule. You can include any text.
User who created or last modified the rule.
Previous name of the rule. Required for rule renaming.
Script is the custom check script.
Severity is the custom check defined severity.
Title is the custom check title.
Responses
- 200
- default
CustomComplianceCheck represents a custom compliance check entry
- application/json
- Schema
- Example (from schema)
Schema
ID is the compliance check ID.
Indicates whether the rule is currently disabled. Values: true (disabled) or false (enabled).
Specifies the date and time when the rule was last modified.
Name of the rule.
Describes any noteworthy points for a rule. You can include any text.
User who created or last modified the rule.
Previous name of the rule. Required for rule renaming.
Script is the custom check script.
Severity is the custom check defined severity.
Title is the custom check title.
{
"_id": 0,
"disabled": true,
"modified": "2024-07-29T15:51:28.071Z",
"name": "string",
"notes": "string",
"owner": "string",
"previousName": "string",
"script": "string",
"severity": "string",
"title": "string"
}