Palo Alto Cortex XDR Executor¶
Category: Endpoint Security
Script: cortex_xdr.py
Integration: REST API
Faraday Plugin: Raw JSON
Website: https://www.paloaltonetworks.com/cortex/cortex-xdr
Description¶
Imports managed endpoints, incidents and alerts from Palo Alto Cortex XDR into Faraday. Each endpoint becomes a host and its incidents and alerts become vulnerabilities.
Prerequisites¶
- A Cortex XDR tenant
- A Standard API key (API key and API key ID) created in the Cortex XDR console under Settings > Configurations > Integrations > API Keys
- Python
requestsmodule available to the agent
Configuration¶
Environment Variables (Setup)¶
| Variable | Required | Description |
|---|---|---|
CXDR_HOST |
Yes | Tenant API host shown in the API key dialog (e.g., api-mytenant.xdr.us.paloaltonetworks.com) |
CXDR_API_KEY_ID |
Yes | API key ID |
CXDR_API_KEY |
Yes | API key |
CXDR_VERIFY_SSL |
No | Set to 0, false, no or off to disable TLS certificate verification (default: verification enabled) |
Execution Arguments¶
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
CXDR_MIN_SEVERITY |
string | No | Minimum severity to import: low, medium, high or critical (aliases such as informational and numbers 1 to 4 are also accepted). Leave blank to import everything. |
CXDR_INCIDENT_STATUS |
string | No | Comma-separated incident statuses to import (e.g., new,under_investigation). Also accepts open, closed, resolved and false_positive. Leave blank to import all statuses. This filter applies to incidents only. |
YAML Configuration Example¶
executors:
cortex_xdr:
repo_executor: cortex_xdr.py
max_size: 65536
varenvs:
CXDR_HOST: "api-mytenant.xdr.us.paloaltonetworks.com"
CXDR_API_KEY_ID: "<api_key_id>"
CXDR_API_KEY: "<api_key>"
params:
CXDR_MIN_SEVERITY:
mandatory: false
type: string
base: string
CXDR_INCIDENT_STATUS:
mandatory: false
type: string
base: string
How It Works¶
- Sends the API key and key ID (
Authorizationandx-xdr-auth-idheaders) with every request - Reads incidents (
/public_api/v1/incidents/get_incidents/), endpoints (/public_api/v1/endpoints/get_endpoints/) and alerts (/public_api/v1/alerts/get_alerts_multi_events) withPOSTrequests, 100 records per page. The severity and status filters are sent to Cortex XDR. - Creates one host per endpoint, using its first non-loopback IP address
- Adds each incident to every endpoint it affects and each alert to its endpoint, as
[EDR]vulnerabilities. Severity 1 to 4 becomes low, medium, high and critical. - Maps status:
newandunder_investigationare open,resolved_threat_handled,resolved_known_issueandresolved_otherare closed, and false-positive, duplicate, auto and security-testing resolutions are risk-accepted.
Notes¶
- Incidents and alerts that cannot be linked to a known endpoint are grouped on a host with IP
0.0.0.0. Endpoints without an IP also use0.0.0.0. - Endpoints are imported as hosts even when they have no incidents or alerts.
- A 401 response stops the run; other errors are written to the agent log.
- The shared agent parameters (
AGENT_CONFIG_*tags and severity filters) are not applied by this executor. UseCXDR_MIN_SEVERITYto filter by severity.