Validate Policies - Code-based
POST/code/api/v1/policies/definition/:queryId
Prisma Cloud Application Security supports policy-as-code capabilities using YAML-based policy definition files to enable attribute and connection checks (composite checks).
For information on defining YAML-based policies, see the Prisma Cloud documentation about the Code Editor and Custom Build Policy Examples. If you are upgraded to Darwin, see Code Editor and Custom Build Policy Examples.
To use the API request, add your token to the header. API supports both YAML and JSON configuration of Prisma Cloud Application Security custom policy schema.
This API is used to validate a user defined Prisma Cloud Application Security YAML-based custom policy schema. It returns an array of errors for not supported keys, values, and more. This call is used to verify that a custom policy which is about to be saved is properly configured.
Policy definitions include the following types: option 1 - "attribute" block (defined by cond_type=attribute) - checks the specific attributes of a given resource type option 2 - "connection" block (defined by cond_type=connection) - checks the existence of connection between given two resource group types option 3 - "filter" block (defined by cond_type=filter) - return given resource group types option 4 - "and"/"or" - structure that supports nested "and"/"or" logic and blocks for options 1, 2 and 3 Use the given examples as a reference for configuring the API request body.
Request
Responses
- 200
- 400
- 403
- 422
Policy definition
Invalid policy
Payment required
Request arguments validation error