Save new policy
Prisma Cloud Code Security supports policy-as-code capabilities using YAML-based policy definition files to enable attribute and connection checks (composite checks).
To use the API request, add your token to the header. API supports both YAML and JSON configuration of Prisma Cloud Code Security custom policy schema)
This API creates a new Prisma Cloud Code Security custom policy. The input will be a code-based policy definition file. The output will be a new policy id. In case of invalid code - output will include definition errors. Use the example below as a reference for configuring the API request body for saving new policies.
- application/json
Request Body required
benchmarks object
property name* object
Array [string]- category CategoryType
Possible values: [
elasticsearch
,general
,iam
,logging
,monitoring
,networking
,public
,secrets
,serverless
,storage
,kubernetes
,vulnerabilities
,compute
,vcs
,buildIntegrity
,licenses
,alibabacloud
] code object
- anyOf
- PolicyDefinition
- MOD2
definition object required
- anyOf
- AttributeQuery
- ConnectionQuery
- FilterQuery
- ComplexQuery
attribute string requiredcond_type string requiredPossible values: [
attribute
]operator AttributeOperator requiredPossible values: [
within
,equals
,not_equals
,regex_match
,not_regex_match
,greater_than
,greater_than_or_equal
,less_than
,less_than_or_equal
,exists
,not_exists
,contains
,not_contains
,starting_with
,not_starting_with
,ending_with
,not_ending_with
,jsonpath_equals
,jsonpath_not_equals
,jsonpath_exists
,jsonpath_not_exists
,subset
,not_subset
]resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]value object
- anyOf
- MOD1
- MOD2
- MOD3
stringbooleanArray [string]cond_type string requiredPossible values: [
connection
]connected_resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]operator string requiredPossible values: [
exists
,not_exists
]resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]attribute string requiredPossible values: [
resource_type
]cond_type string requiredPossible values: [
filter
]operator string requiredPossible values: [
within
]value string[] requiredand object[]
Array [- anyOf
- AttributeQuery
- ConnectionQuery
- FilterQuery
attribute string requiredcond_type string requiredPossible values: [
attribute
]operator AttributeOperator requiredPossible values: [
within
,equals
,not_equals
,regex_match
,not_regex_match
,greater_than
,greater_than_or_equal
,less_than
,less_than_or_equal
,exists
,not_exists
,contains
,not_contains
,starting_with
,not_starting_with
,ending_with
,not_ending_with
,jsonpath_equals
,jsonpath_not_equals
,jsonpath_exists
,jsonpath_not_exists
,subset
,not_subset
]resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]value object
- anyOf
- MOD1
- MOD2
- MOD3
stringbooleanArray [string]cond_type string requiredPossible values: [
connection
]connected_resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]operator string requiredPossible values: [
exists
,not_exists
]resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]attribute string requiredPossible values: [
resource_type
]cond_type string requiredPossible values: [
filter
]operator string requiredPossible values: [
within
]value string[] required]not object
- anyOf
- MOD1
Array [- anyOf
- AttributeQuery
- ConnectionQuery
- FilterQuery
attribute string requiredcond_type string requiredPossible values: [
attribute
]operator AttributeOperator requiredPossible values: [
within
,equals
,not_equals
,regex_match
,not_regex_match
,greater_than
,greater_than_or_equal
,less_than
,less_than_or_equal
,exists
,not_exists
,contains
,not_contains
,starting_with
,not_starting_with
,ending_with
,not_ending_with
,jsonpath_equals
,jsonpath_not_equals
,jsonpath_exists
,jsonpath_not_exists
,subset
,not_subset
]resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]value object
- anyOf
- MOD1
- MOD2
- MOD3
stringbooleanArray [string]cond_type string requiredPossible values: [
connection
]connected_resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]operator string requiredPossible values: [
exists
,not_exists
]resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]attribute string requiredPossible values: [
resource_type
]cond_type string requiredPossible values: [
filter
]operator string requiredPossible values: [
within
]value string[] required]or object[]
Array [- anyOf
- AttributeQuery
- ConnectionQuery
- FilterQuery
attribute string requiredcond_type string requiredPossible values: [
attribute
]operator AttributeOperator requiredPossible values: [
within
,equals
,not_equals
,regex_match
,not_regex_match
,greater_than
,greater_than_or_equal
,less_than
,less_than_or_equal
,exists
,not_exists
,contains
,not_contains
,starting_with
,not_starting_with
,ending_with
,not_ending_with
,jsonpath_equals
,jsonpath_not_equals
,jsonpath_exists
,jsonpath_not_exists
,subset
,not_subset
]resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]value object
- anyOf
- MOD1
- MOD2
- MOD3
stringbooleanArray [string]cond_type string requiredPossible values: [
connection
]connected_resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]operator string requiredPossible values: [
exists
,not_exists
]resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]attribute string requiredPossible values: [
resource_type
]cond_type string requiredPossible values: [
filter
]operator string requiredPossible values: [
within
]value string[] required]metadata object required
category CategoryType requiredPossible values: [
elasticsearch
,general
,iam
,logging
,monitoring
,networking
,public
,secrets
,serverless
,storage
,kubernetes
,vulnerabilities
,compute
,vcs
,buildIntegrity
,licenses
,alibabacloud
]guidelines string requiredname string requiredseverity SeverityType requiredPossible values: [
critical
,high
,medium
,low
,info
]scope object required
provider ProviderType requiredPossible values: [
aws
,gcp
,azure
,kubernetes
,oci
,openstack
,packages
,git
,linode
,digitalocean
,panos
,licenses
,alibabacloud
]string- anyOf
conditions object
- anyOf
- AttributeQuery
- ConnectionQuery
- FilterQuery
- ComplexQuery
attribute string requiredcond_type string requiredPossible values: [
attribute
]operator AttributeOperator requiredPossible values: [
within
,equals
,not_equals
,regex_match
,not_regex_match
,greater_than
,greater_than_or_equal
,less_than
,less_than_or_equal
,exists
,not_exists
,contains
,not_contains
,starting_with
,not_starting_with
,ending_with
,not_ending_with
,jsonpath_equals
,jsonpath_not_equals
,jsonpath_exists
,jsonpath_not_exists
,subset
,not_subset
]resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]value object
- anyOf
- MOD1
- MOD2
- MOD3
stringbooleanArray [string]cond_type string requiredPossible values: [
connection
]connected_resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]operator string requiredPossible values: [
exists
,not_exists
]resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]attribute string requiredPossible values: [
resource_type
]cond_type string requiredPossible values: [
filter
]operator string requiredPossible values: [
within
]value string[] requiredand object[]
Array [- anyOf
- AttributeQuery
- ConnectionQuery
- FilterQuery
attribute string requiredcond_type string requiredPossible values: [
attribute
]operator AttributeOperator requiredPossible values: [
within
,equals
,not_equals
,regex_match
,not_regex_match
,greater_than
,greater_than_or_equal
,less_than
,less_than_or_equal
,exists
,not_exists
,contains
,not_contains
,starting_with
,not_starting_with
,ending_with
,not_ending_with
,jsonpath_equals
,jsonpath_not_equals
,jsonpath_exists
,jsonpath_not_exists
,subset
,not_subset
]resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]value object
- anyOf
- MOD1
- MOD2
- MOD3
stringbooleanArray [string]cond_type string requiredPossible values: [
connection
]connected_resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]operator string requiredPossible values: [
exists
,not_exists
]resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]attribute string requiredPossible values: [
resource_type
]cond_type string requiredPossible values: [
filter
]operator string requiredPossible values: [
within
]value string[] required]not object
- anyOf
- MOD1
Array [- anyOf
- AttributeQuery
- ConnectionQuery
- FilterQuery
attribute string requiredcond_type string requiredPossible values: [
attribute
]operator AttributeOperator requiredPossible values: [
within
,equals
,not_equals
,regex_match
,not_regex_match
,greater_than
,greater_than_or_equal
,less_than
,less_than_or_equal
,exists
,not_exists
,contains
,not_contains
,starting_with
,not_starting_with
,ending_with
,not_ending_with
,jsonpath_equals
,jsonpath_not_equals
,jsonpath_exists
,jsonpath_not_exists
,subset
,not_subset
]resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]value object
- anyOf
- MOD1
- MOD2
- MOD3
stringbooleanArray [string]cond_type string requiredPossible values: [
connection
]connected_resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]operator string requiredPossible values: [
exists
,not_exists
]resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]attribute string requiredPossible values: [
resource_type
]cond_type string requiredPossible values: [
filter
]operator string requiredPossible values: [
within
]value string[] required]or object[]
Array [- anyOf
- AttributeQuery
- ConnectionQuery
- FilterQuery
attribute string requiredcond_type string requiredPossible values: [
attribute
]operator AttributeOperator requiredPossible values: [
within
,equals
,not_equals
,regex_match
,not_regex_match
,greater_than
,greater_than_or_equal
,less_than
,less_than_or_equal
,exists
,not_exists
,contains
,not_contains
,starting_with
,not_starting_with
,ending_with
,not_ending_with
,jsonpath_equals
,jsonpath_not_equals
,jsonpath_exists
,jsonpath_not_exists
,subset
,not_subset
]resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]value object
- anyOf
- MOD1
- MOD2
- MOD3
stringbooleanArray [string]cond_type string requiredPossible values: [
connection
]connected_resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]operator string requiredPossible values: [
exists
,not_exists
]resource_types object required
- anyOf
- MOD1
- MOD2
Array [string]stringPossible values: [
all
]attribute string requiredPossible values: [
resource_type
]cond_type string requiredPossible values: [
filter
]operator string requiredPossible values: [
within
]value string[] required]- anyOf
- frameworks FrameworkType[]
Possible values: [
Terraform
,CloudFormation
,Kubernetes
,TerraformPlan
,Helm
,Kustomize
,Serverless
,ARM
,Bicep
,Git
,AWS
,GCP
,Azure
,DockerImage
,Docker
,Vulnerabilities
,VCS
,OpenAPI
,GithubAction
,SCA
] - guidelines string
- provider ProviderType
Possible values: [
aws
,gcp
,azure
,kubernetes
,oci
,openstack
,packages
,git
,linode
,digitalocean
,panos
,licenses
,alibabacloud
] - severity SeverityType
Possible values: [
critical
,high
,medium
,low
,info
] - title string
- 200
- 400
- 403
- 422
- 500
Save a new policy data
- application/json
- Schema
- Example (from schema)
Schema
- anyOf
- ErrorMessage
- PolicyRes
message string requiredpolicy string required
{
"message": "string"
}
Policy Validation Error
Payment required
Request arguments validation error
Failed to create new policy