Skip to content

Palo Alto Cortex XSOAR Executor

Category: SIEM and SOAR Script: xsoar.py Integration: REST API Faraday Plugin: Raw JSON Website: https://www.paloaltonetworks.com/cortex/cortex-xsoar

Description

Imports security incidents from Palo Alto Cortex XSOAR into Faraday. Each incident becomes a vulnerability on the asset it affects.

Prerequisites

  • A Cortex XSOAR tenant (classic XSOAR 6 or XSOAR 8 / Cortex platform)
  • An API key with permission to read incidents. XSOAR 8 also requires the API key ID.
  • Network access to the XSOAR tenant URL

Configuration

Environment Variables (Setup)

Variable Required Description
XSOAR_HOST Yes XSOAR tenant URL (e.g., https://mytenant.xsoar.paloaltonetworks.com)
XSOAR_API_KEY Yes XSOAR API key
XSOAR_API_KEY_ID No API key ID. Required by XSOAR 8 / Cortex platform tenants and not needed for classic XSOAR 6.

These variables are also accepted as execution arguments, so a single run can override them.

Execution Arguments

Parameter Type Mandatory Description
XSOAR_INCIDENT_FILTER string No XSOAR query to select incidents (e.g., type:"Phishing" status:1 or severity:>=2 -status:2). Default: all incidents.
XSOAR_FROM_DATE string No Only import incidents that occurred after this date, in ISO-8601 format (e.g., 2026-01-01T00:00:00.000Z) or as a relative expression such as 7 days ago

YAML Configuration Example

executors:
  xsoar:
    repo_executor: xsoar.py
    max_size: 65536
    varenvs:
      XSOAR_HOST: "https://mytenant.xsoar.paloaltonetworks.com"
      XSOAR_API_KEY: "<xsoar_api_key>"
      XSOAR_API_KEY_ID: "<xsoar_api_key_id>"
    params:
      XSOAR_INCIDENT_FILTER:
        mandatory: false
        type: string
        base: string
      XSOAR_FROM_DATE:
        mandatory: false
        type: string
        base: string

How It Works

  1. Authenticates with the Authorization header set to XSOAR_API_KEY, plus x-xdr-auth-id when XSOAR_API_KEY_ID is set
  2. Searches incidents with POST /incidents/search, 100 per page, applying XSOAR_INCIDENT_FILTER and XSOAR_FROM_DATE
  3. Reads each incident with GET /incident/{id} to get its labels and custom fields
  4. Maps each incident to a vulnerability:
    • Name: the incident name
    • Severity: XSOAR severity (4 critical, 3 high, 2 medium, 1 low, otherwise info)
    • Status: incidents that have a close reason, or are done or archived, are closed. All others are open.
    • Resolution: the close reason and close notes
    • References: source brand, playbook and linked indicators, plus any CVEs found in labels or custom fields
  5. Groups incidents by the affected asset found in the incident labels or custom fields (IP, hostname, OS, MAC)

Notes

  • Incidents with no IP or hostname in their labels or custom fields are grouped under a host with IP 0.0.0.0.
  • There is no severity filter. Use XSOAR_INCIDENT_FILTER (e.g., severity:>=2) to limit the incidents.
  • XSOAR_HOST may be given without https://, which is added automatically.
  • A 401 response stops the run. Other API errors are logged and the affected page or incident is skipped.
  • The shared agent parameters (AGENT_CONFIG_* tags and severity filters) are not applied by this executor.