Skip to main content

Update Custom Compliance Checks

PUT 

/api/v32.04/custom-compliance

x-prisma-cloud-target-env: {"permission":"policyComplianceCustomRules","saas":true,"self-hosted":true}
x-public: true

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

Body

    _id integer

    ID is the compliance check ID.

    disabled boolean

    Indicates if the rule is currently disabled (true) or not (false).

    modified date-time

    Datetime when the rule was last modified.

    name string

    Name of the rule.

    notes string

    Free-form text.

    owner string

    User who created or last modified the rule.

    previousName string

    Previous name of the rule. Required for rule renaming.

    script string

    Script is the custom check script.

    severity string

    Severity is the custom check defined severity.

    title string

    Title is the custom check title.

Responses

CustomComplianceCheck represents a custom compliance check entry

Schema
    _id integer

    ID is the compliance check ID.

    disabled boolean

    Indicates if the rule is currently disabled (true) or not (false).

    modified date-time

    Datetime when the rule was last modified.

    name string

    Name of the rule.

    notes string

    Free-form text.

    owner string

    User who created or last modified the rule.

    previousName string

    Previous name of the rule. Required for rule renaming.

    script string

    Script is the custom check script.

    severity string

    Severity is the custom check defined severity.

    title string

    Title is the custom check title.

Loading...