Get Threat PCAP - Palo Alto PAN-OS XML API
Browse: 🏠 · Solutions · Connectors · Methods · Tables · Content · Parsers · ASIM Parsers · ASIM Products · 📊
↑ Back to Content Index
This playbook allows us to get a threat PCAP for a given PCAP ID.
Additional Documentation
📄 Source: PaloAltoPlaybooks/PaloAlto-PAN-OS-GetThreatPCAP/readme.md
PaloAlto-PAN-OS-GetThreatPCAP
## Summary
This playbook allows us to get a threat PCAP for a given PCAP ID.
When a new Sentinel incident is created, this playbook gets triggered and performs below actions:
-
Gets the various parameters from the alert
-
Gets the PCAP from the device.
-
Puts the PCAP in Blob Storage
-
Creates a Sentinel Incident and updates it with a link to the blob.
Prerequisites
- PaloAlto connector needs to be deployed prior to the deployment of this playbook under the same subscription. Relevant instructions can be found in the connector doc page.
- Generate an API key.Refer this link on how to generate the API Key
- This playbook only works for Palo Alto incidents with a threat PCAP where the PCAP ID is not null or zero.
Deployment instructions
- Deploy the playbook by clicking on "Deploy to Azure" button. This will take you to deploying an ARM Template wizard.

- Fill in the required parameters:
- Playbook Name: The playbook name here (e.g. PaloAlto-PAN-OS-GetThreatPCAP)
- StorageAccountName: The blob storage account where the threat PCAP will be stored
- StorageAccountFolderPath: The folder in the blob storage account where the threat PCAP will be stored
- LogAnalyticsResourceGroup: The Log Analytics resource group for logging for the Playbook.
- LogAnalyticsResourceName: The Log Analytics resource for logging for the Playbook.
- CustomConnectorName : Name of the custom connector, if you want to change the default name, make sure to use the same in all PaloAlto automation playbooks as well
Post-Deployment instructions
a. Authorize connections
Once deployment is complete, you will need to authorize each connection.
1. Click the Microsoft Sentinel connection resource
2. Click edit API connection
3. Click Authorize
4. Sign in
5. Click Save
6. Repeat steps for other connections such as Blob Store connection and PAN-OS API connection (For authorizing the PAN-OS API connection, API Key needs to be provided)
b. Configurations in Sentinel
- In Microsoft sentinel analytical rules should be configured to trigger an incident with results having column "TimeGenerated", "Computer", "pcap_id", "sessionid", "event_time".
- Entity mapping not needed beacuse playbook will internally hit the query again and fetches the required column from result.
- Configure the automation rules to trigger this playbook
c. Assign Playbook Microsoft Sentinel Responder Role
- Select the Playbook (Logic App) resource
- Click on Identity Blade
- Choose System assigned tab
- Click on Azure role assignments
- Click on Add role assignments
- Select Scope - Resource group
- Select Subscription - where Playbook has been created
- Select Resource group - where Playbook has been created
- Select Role - Microsoft Sentinel Responder
- Click Save (It takes 3-5 minutes to show the added role.)
Playbook steps explained
When Microsoft Sentinel incident creation rule is triggered
Microsoft Sentinel incident is created. The playbook receives the incident as the input.
Run Query and List Results
Get the logs from the incident.
For Each
Iterates on each result and performs the following:
If alert is Palo Alto alert
Checks if the alert is a Palo Alto alert. Required when logs from various devices are present
If PCAP ID exists
Checks if a PCAP ID is present, and that it is not equal to zero. If the PCAP ID is absent or if it is zero, no PCAP exists.
Query XML API
Sets the PCAP ID, time generated, Session ID and the device name, and queries the device's XML API to retrieve a threat PCAP
Create Blob (V2)
Creates a blob in aV2 blob storage account, denoted by Storage Account Name, in the folder denoted by the Folder Path with a name of the type "paloalto1235678920220101102000.pcap" where the name is a concatenation of the "paloalto"+pcapid+timegenerated+".pcap"
Alert - Get Incident
Creates Incident for the alert
Adds a comment containing a link to the pcap in the blob storage to the incident
Browse: 🏠 · Solutions · Connectors · Methods · Tables · Content · Parsers · ASIM Parsers · ASIM Products · 📊
↑ Back to Playbooks · Back to PaloAlto-PAN-OS