Detection Rules
API for managing detection rules including CRUD operations for security policies, compliance metadata, and rule configurations.
Creates a new detection rule with the specified configuration including name, severity, query, and compliance metadata. The rule will be validated and persisted if all required fields are provided correctly.
api_key_id authentication identifier
123Request body for creating a detection rule
Unique rule name
GCP BigQuery Table not encrypted with CMEKPattern: \SDetailed rule description
This policy identifies GCP BigQuery tables...Rule class - Must be 'config' (CSPM)
configPattern: \SRule type - Must be 'DETECTION' (can be inferred if not provided)
DETECTIONArray with single asset type identifier (exactly one required)
["gcp-bigquery-dataset"]Rule severity (low, medium, high, critical, informational)
highPattern: \SCustom labels (max 50, each max 100 chars)
["Custom Rule","Security"]Rule enabled status (default: true)
trueRule successfully created
Response for rule operations
Unique rule identifier
c053f2b7-a106-4550-9f9e-6272e5a45a04Rule name
GCP BigQuery Table not encrypted with CMEKRule description
This policy identifies GCP BigQuery tables...Rule class
configRule type
DETECTIONCloud providers (derived from asset_types)
["gcp"]Array of asset type identifiers
["gcp-bigquery-dataset"]Rule severity
highCustom labels
["Custom Rule","Encryption"]Rule enabled status
trueSystem default rule indicator
Creator identifier
user@example.comCreation timestamp (epoch milliseconds)
1733452350456Last modifier
user@example.comLast modification timestamp (epoch milliseconds)
1733452350456Deletion status
trueDeletion timestamp (epoch milliseconds)
1733552350456User who deleted the rule
admin@example.comBad Request - Invalid parameters
Unauthorized
Forbidden
Conflict - Rule with same name already exists
Too Many Requests
Internal Server Error
Bad Gateway
Service Unavailable
POST /public_api/v1/rule HTTP/1.1
Host: api-cortex.paloaltonetworks.com
x-xdr-auth-id: text
Content-Type: application/json
Accept: */*
Content-Length: 657
{
"name": "AWS S3 Bucket with Public Access",
"description": "Identifies S3 buckets that allow public access",
"rule_class": "config",
"asset_types": [
"aws-s3-bucket"
],
"severity": "high",
"query": {
"xql": "dataset = cloud_resource_inventory | filter cloud_provider = \"AWS\" and asset_type = \"AWS::S3::Bucket\" | filter json_extract(config, \"$.acl.grants[*].grantee.uri\") contains \"AllUsers\" | fields asset_id, asset_name, cloud_account_id, region"
},
"metadata": {
"issue": {
"recommendation": "Remove public access from the S3 bucket by updating the bucket ACL..."
}
},
"compliance_metadata": [
{
"control_id": "CIS-AWS-2.1.5"
}
],
"labels": [
"S3",
"Public Access"
],
"enabled": true
}{
"id": "c053f2b7-a106-4550-9f9e-6272e5a45a04",
"name": "GCP BigQuery Table not encrypted with CMEK",
"description": "This policy identifies GCP BigQuery tables that are not encrypted with Customer Managed Encryption Keys (CMEK)",
"rule_class": "config",
"type": "DETECTION",
"providers": [
"gcp"
],
"asset_types": [
"gcp-bigquery-dataset"
],
"severity": "high",
"query": {
"xql": "dataset = cloud_resource_inventory | filter cloud_provider = \"GCP\" and asset_type = \"GCP::BigQuery::Table\" | filter json_extract(config, \"$.encryptionConfiguration.kmsKeyName\") = null | fields asset_id, asset_name, cloud_account_id, region"
},
"metadata": {
"issue": {
"recommendation": "To configure a Customer-managed encryption key (CMEK) for BigQuery Table, follow the steps..."
}
},
"compliance_metadata": [
{
"standard_name": "Health Insurance Portability and Accountability Act",
"control_id": "164.312(a)(2)(iv)",
"control_name": "Encryption and Decryption"
},
{
"standard_name": "Payment Card Industry Data Security Standard",
"control_id": "3.5.1",
"control_name": "Protect encryption keys"
}
],
"labels": [
"Custom Rule",
"Encryption"
],
"enabled": true,
"system_default": false,
"created_by": "user@example.com",
"created_on": 1733452350456,
"last_modified_by": "user@example.com",
"last_modified_on": 1733452350456
}Searches for detection rules based on filter criteria with support for pagination and sorting. Returns a list of rules matching the specified filters.
api_key_id authentication identifier
123Request body for querying detection rules
Offset index for pagination
Ending index for pagination. The default is 100, and it can be up to 1000. For example, when search_from is 10 and search_to is 100, the API retrieves results from index 10 through 100.
100Example: 100OK
Response containing a list of detection rules with metadata
Bad Request
Unauthorized
Forbidden
Not Found
Too many requests
Internal Server Error
Bad Gateway
Service Unavailable
POST /public_api/v1/rule/search HTTP/1.1
Host: api-cortex.paloaltonetworks.com
x-xdr-auth-id: text
Content-Type: application/json
Accept: */*
Content-Length: 375
{
"filter": {
"OR": [
{
"SEARCH_FIELD": "id",
"SEARCH_TYPE": "EQ",
"SEARCH_VALUE": "4f900112-eb70-490e-a867-63a31769a786"
},
{
"SEARCH_FIELD": "id",
"SEARCH_TYPE": "EQ",
"SEARCH_VALUE": "1236bf26-18d5-4393-885d-e828115f5836"
},
{
"SEARCH_FIELD": "id",
"SEARCH_TYPE": "EQ",
"SEARCH_VALUE": "e928a48c-c734-4d89-895f-24220616c2ef"
}
]
},
"search_from": 0,
"search_to": 50,
"sort": [
{
"FIELD": "name",
"ORDER": "ASC"
}
]
}{
"data": [
{
"id": "19403de7-0b16-476f-97c1-2e15ffcb9ab4",
"name": "Authorization bypass risk due to a publicly exposed Azure Virtual Machine with an unauthorized Docker API access vulnerability (Docker, CVE-2024-41110)",
"description": "Publicly exposed Azure Virtual Machines with unauthorized Docker API access (CVE-2024-41110) pose a significant authorization bypass risk, enabling attackers to execute arbitrary commands and escalate privileges.",
"class": "config",
"module": "CSPM",
"asset_types": [
"azure-vm"
],
"severity": "critical",
"enabled": true,
"system_default": true,
"provider": "azure",
"type": "config",
"compliance_metadata": [
{
"standard_name": "CIS Microsoft Azure Foundations Benchmark",
"control_id": "7.1",
"control_name": "Ensure that 'OS and Data' disks are encrypted with CMK"
}
],
"labels": [
"Cloud Security"
],
"created_by": "John Doe",
"created_on": 1756934040224,
"last_modified_by": "Cortex System Admin",
"last_modified_on": 1756934040224
}
],
"metadata": {
"filter_count": 1213,
"total_count": 1213
}
}Retrieves a specific detection rule by its unique identifier. Returns the complete rule configuration including query, compliance metadata, and labels.
Unique identifier of the detection rule to retrieve
a1b2c3d4-e5f6-7890-abcd-ef1234567890api_key_id authentication identifier
123Rule successfully retrieved
Response for rule operations
Unique rule identifier
c053f2b7-a106-4550-9f9e-6272e5a45a04Rule name
GCP BigQuery Table not encrypted with CMEKRule description
This policy identifies GCP BigQuery tables...Rule class
configRule type
DETECTIONCloud providers (derived from asset_types)
["gcp"]Array of asset type identifiers
["gcp-bigquery-dataset"]Rule severity
highCustom labels
["Custom Rule","Encryption"]Rule enabled status
trueSystem default rule indicator
Creator identifier
user@example.comCreation timestamp (epoch milliseconds)
1733452350456Last modifier
user@example.comLast modification timestamp (epoch milliseconds)
1733452350456Deletion status
trueDeletion timestamp (epoch milliseconds)
1733552350456User who deleted the rule
admin@example.comBad Request - Invalid ID format
Unauthorized
Forbidden
Not Found - Rule does not exist
Too Many Requests
Internal Server Error
Bad Gateway
Service Unavailable
GET /public_api/v1/rule/{id} HTTP/1.1
Host: api-cortex.paloaltonetworks.com
x-xdr-auth-id: text
Accept: */*
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "AWS S3 Bucket with Public Access",
"description": "Identifies S3 buckets that allow public access",
"rule_class": "config",
"type": "DETECTION",
"providers": [
"aws"
],
"asset_types": [
"aws-s3-bucket"
],
"severity": "high",
"query": {
"xql": "dataset = cloud_resource_inventory | filter cloud_provider = \"AWS\" and asset_type = \"AWS::S3::Bucket\" | filter json_extract(config, \"$.acl.grants[*].grantee.uri\") contains \"AllUsers\" | fields asset_id, asset_name, cloud_account_id, region"
},
"metadata": {
"issue": {
"recommendation": "Remove public access from the S3 bucket by updating the bucket ACL..."
}
},
"compliance_metadata": [
{
"standard_name": "CIS Amazon Web Services Foundations Benchmark",
"control_id": "2.1.5",
"control_name": "Ensure S3 buckets are configured with Block public access"
}
],
"labels": [
"S3",
"Public Access"
],
"enabled": true,
"system_default": false,
"created_by": "user@example.com",
"created_on": 1733452350456,
"last_modified_by": "user@example.com",
"last_modified_on": 1733452350456
}Permanently deletes a detection rule by its unique identifier. This action cannot be undone. Only custom rules can be deleted; system default rules cannot be removed.
Unique identifier of the detection rule to delete
a1b2c3d4-e5f6-7890-abcd-ef1234567890api_key_id authentication identifier
123Rule successfully deleted (no content)
No content
Bad Request - Invalid ID format
Unauthorized
Forbidden
Not Found - Rule does not exist
Too Many Requests
Internal Server Error
Bad Gateway
Service Unavailable
DELETE /public_api/v1/rule/{id} HTTP/1.1
Host: api-cortex.paloaltonetworks.com
x-xdr-auth-id: text
Accept: */*
No content
Updates an existing detection rule with the provided fields. Only the fields included in the request body will be updated. The rule_class field is required for validation.
Unique identifier of the detection rule to update
a1b2c3d4-e5f6-7890-abcd-ef1234567890api_key_id authentication identifier
123Request body for updating a detection rule
Rule name (must be unique if changed)
Updated AWS S3 Bucket RuleRule description
Updated description...Rule class - Must be 'config' (CSPM)
configRule type - Must be 'DETECTION'
DETECTIONArray with single asset type identifier (exactly one if provided)
["aws-s3-bucket"]Rule severity (low, medium, high, critical, informational)
highCustom labels (max 50, each max 100 chars)
["Updated","Security"]Rule enabled status
trueRule successfully updated
Response for rule operations
Unique rule identifier
c053f2b7-a106-4550-9f9e-6272e5a45a04Rule name
GCP BigQuery Table not encrypted with CMEKRule description
This policy identifies GCP BigQuery tables...Rule class
configRule type
DETECTIONCloud providers (derived from asset_types)
["gcp"]Array of asset type identifiers
["gcp-bigquery-dataset"]Rule severity
highCustom labels
["Custom Rule","Encryption"]Rule enabled status
trueSystem default rule indicator
Creator identifier
user@example.comCreation timestamp (epoch milliseconds)
1733452350456Last modifier
user@example.comLast modification timestamp (epoch milliseconds)
1733452350456Deletion status
trueDeletion timestamp (epoch milliseconds)
1733552350456User who deleted the rule
admin@example.comBad Request - Invalid parameters
Unauthorized
Forbidden
Not Found - Rule does not exist
Conflict - Name already exists
Too Many Requests
Internal Server Error
Bad Gateway
Service Unavailable
PATCH /public_api/v1/rule/{id} HTTP/1.1
Host: api-cortex.paloaltonetworks.com
x-xdr-auth-id: text
Content-Type: application/json
Accept: */*
Content-Length: 840
{
"name": "Updated AWS S3 Bucket Policy",
"description": "Updated description for S3 bucket policy",
"rule_class": "config",
"type": "DETECTION",
"asset_types": [
"aws-s3-bucket"
],
"severity": "critical",
"query": {
"xql": "dataset = cloud_resource_inventory | filter cloud_provider = \"AWS\" and asset_type = \"AWS::S3::Bucket\" | filter json_extract(config, \"$.acl.grants[*].grantee.uri\") contains \"AllUsers\" | fields asset_id, asset_name, cloud_account_id, region, config"
},
"metadata": {
"issue": {
"recommendation": "Updated remediation steps:\n1. Login to AWS Console\n2. Navigate to S3\n3. Select the bucket\n4. Go to Permissions tab\n5. Edit Block Public Access settings\n6. Enable all Block Public Access options"
}
},
"compliance_metadata": [
{
"control_id": "CIS-AWS-2.1.5"
},
{
"control_id": "NIST-AC-3"
}
],
"labels": [
"Updated",
"S3",
"Critical"
],
"enabled": true
}{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Updated AWS S3 Bucket Policy",
"description": "Updated description for S3 bucket policy",
"rule_class": "config",
"type": "DETECTION",
"providers": [
"aws"
],
"asset_types": [
"aws-s3-bucket"
],
"severity": "critical",
"query": {
"xql": "dataset = cloud_resource_inventory | filter cloud_provider = \"AWS\" and asset_type = \"AWS::S3::Bucket\" | filter json_extract(config, \"$.acl.grants[*].grantee.uri\") contains \"AllUsers\" | fields asset_id, asset_name, cloud_account_id, region"
},
"metadata": {
"issue": {
"recommendation": "Updated remediation steps..."
}
},
"compliance_metadata": [
{
"standard_name": "CIS Amazon Web Services Foundations Benchmark",
"control_id": "2.1.5",
"control_name": "Ensure S3 buckets are configured with Block public access"
}
],
"labels": [
"Updated",
"S3",
"Critical"
],
"enabled": true,
"system_default": false,
"created_by": "user@example.com",
"created_on": 1733452350456,
"last_modified_by": "admin@example.com",
"last_modified_on": 1733552350456
}Last updated
Was this helpful?
