Palo Alto Cortex Xpanse Executor¶
Category: Attack Surface Management
Script: cortex_xpanse.py
Integration: REST API
Faraday Plugin: Raw JSON
Website: https://www.paloaltonetworks.com/cortex/xpanse
Description¶
Imports the externally exposed assets, services and issues discovered by Palo Alto Cortex Xpanse into Faraday. Each Xpanse asset becomes a host, with its exposed services and its issues as vulnerabilities.
Prerequisites¶
- A Cortex Xpanse tenant
- A Standard API key (API key and API key ID) created in the Xpanse console under Settings > Configurations > API Keys
- Python
requestsmodule available to the agent
Configuration¶
Environment Variables (Setup)¶
| Variable | Required | Description |
|---|---|---|
XPANSE_HOST |
Yes | Tenant API host shown in the API key dialog (e.g., api-mytenant.xpanse.paloaltonetworks.com). https:// is added if missing. |
XPANSE_API_KEY_ID |
Yes | API key ID |
XPANSE_API_KEY |
Yes | API key |
These variables are also accepted as execution arguments, so a single run can override them.
Execution Arguments¶
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
XPANSE_BUSINESS_UNIT |
string | No | Only import data of this business unit. Leave blank to import all business units the key can access. |
XPANSE_MIN_SEVERITY |
string | No | Minimum severity to import: info, low, medium, high or critical. Leave blank to import everything. Unrecognized values are ignored. |
XPANSE_PAGES |
string | No | Maximum number of pages (100 records each) to read from each list (default: 5, maximum: 50) |
YAML Configuration Example¶
executors:
cortex_xpanse:
repo_executor: cortex_xpanse.py
max_size: 65536
varenvs:
XPANSE_HOST: "api-mytenant.xpanse.paloaltonetworks.com"
XPANSE_API_KEY_ID: "<api_key_id>"
XPANSE_API_KEY: "<api_key>"
params:
XPANSE_BUSINESS_UNIT:
mandatory: false
type: string
base: string
XPANSE_MIN_SEVERITY:
mandatory: false
type: string
base: string
XPANSE_PAGES:
mandatory: false
type: string
base: string
How It Works¶
- Sends the API key and key ID (
Authorizationandx-xdr-auth-idheaders) with every request - Reads assets from
GET /api/v1/assets, services fromGET /api/v1/servicesand issues fromGET /api/v1/issues, using offset pagination and the business unit and severity filters - Creates one host per asset, using its first public IP and its hostnames, and attaches the services and issues that belong to that asset
- Reports each exposed service as a vulnerability and as a Faraday service, and each issue as an
[EASM]vulnerability with its CVEs - Maps severity and status from Xpanse.
newandin_progressissues are open,resolvedandclosedare closed, andrisk_accepted,false_positiveandwont_fixare risk-accepted.
Notes¶
- Assets without an IP (for example domains) use IP
0.0.0.0. Services and issues that do not match any returned asset are grouped on a host named(unattached). - Assets are imported as hosts even when they have no services or issues.
- A 401 response stops the run. Rate limiting (429) and other errors stop reading that list and the records already read are imported.
- The shared agent parameters (
AGENT_CONFIG_*tags and severity filters) are not applied by this executor. UseXPANSE_MIN_SEVERITYto filter by severity.