Palo Alto Networks PAN-OS integration
Block IPs, CIDRs, and FQDNs, manage address objects and groups, and commit changes.
How it works
Each Palo Alto Networks PAN-OS action is a YAML template or Python function in Tracecat's open-source registry, under tools.pan_os. Add an action as a step in a workflow, or give it to an agent as a tool.
Credentials
Add these in Tracecat before running the actions. How credentials work
- Secret
pan_oswithPANOS_API_KEY
Actions
Missing an integration? Write your own actions in YAML or Python in a custom registry and sync them from your Git repository.
Add address group members
Add members of a static address group in the candidate configuration. Reads the group with GET /restapi/{version}/Objects/AddressGroups?name= and writes it with PUT only when membership changes, so repeated calls are idempotent. Commit to apply the change.
Block CIDR
Block a CIDR range by adding an address object to a static address group referenced by a deny rule. Looks up the address object by name, creates it with POST /restapi/{version}/Objects/Addresses if missing, then adds it to the group with PUT /restapi/{version}/Objects/AddressGroups if it is not already a member, so repeated calls do not create duplicates. Changes stay in the candidate configuration; run commit (and commit_all on Panorama) to enforce them. For temporary blocks without a commit, use register_ip_tags with a dynamic address group.
Block FQDN
Block an FQDN by adding an address object to a static address group referenced by a deny rule. Looks up the address object by name, creates it with POST /restapi/{version}/Objects/Addresses if missing, then adds it to the group with PUT /restapi/{version}/Objects/AddressGroups if it is not already a member, so repeated calls do not create duplicates. Changes stay in the candidate configuration; run commit (and commit_all on Panorama) to enforce them. For temporary blocks without a commit, use register_ip_tags with a dynamic address group.
Block IP
Block an IP address by adding an address object to a static address group referenced by a deny rule. Looks up the address object by name, creates it with POST /restapi/{version}/Objects/Addresses if missing, then adds it to the group with PUT /restapi/{version}/Objects/AddressGroups if it is not already a member, so repeated calls do not create duplicates. Changes stay in the candidate configuration; run commit (and commit_all on Panorama) to enforce them. For temporary blocks without a commit, use register_ip_tags with a dynamic address group.
Commit
Commit the candidate configuration on a firewall or Panorama with the XML API (type=commit). Optionally commit only changes made by specific administrators. Returns the job ID, or no job ID when there is nothing to commit; use wait_for_job to wait for completion.
Create address
Create an address object in the candidate configuration with POST /restapi/{version}/Objects/Addresses?name=. Provide exactly one of ip_netmask, ip_range, ip_wildcard, or fqdn. Commit to apply the change.
Create address group
Create a static or dynamic address group in the candidate configuration with POST /restapi/{version}/Objects/AddressGroups?name=. Provide exactly one of static_members or dynamic_filter. Commit to apply the change.
Create security rule
Create a security rule in the candidate configuration with POST /restapi/{version}/Policies/SecurityRules?name= (SecurityPreRules or SecurityPostRules on Panorama). The rule is added at the bottom; use move_security_rule to place it. Commit to apply the change.
Create tag
Create a tag in the candidate configuration with POST /restapi/{version}/Objects/Tags?name=. Commit to apply the change.
Delete address
Delete a address object from the candidate configuration with DELETE /restapi/{version}/Objects/Addresses?name=. Commit to apply the change.
Delete address group
Delete a address group from the candidate configuration with DELETE /restapi/{version}/Objects/AddressGroups?name=. Commit to apply the change.
Delete security rule
Delete a security rule from the candidate configuration with DELETE /restapi/{version}/Policies/${{ "SecurityPreRules" if inputs.rulebase == "pre" else ("SecurityPostRules" if inputs.rulebase == "post" else "SecurityRules") }}?name=. Commit to apply the change.
Disable security rule
Disable a security rule in the candidate configuration. Reads it with GET /restapi/{version}/Policies/SecurityRules?name= and writes it with PUT only when the state changes, so repeated calls are idempotent. Commit to apply the change.
Enable security rule
Enable a security rule in the candidate configuration. Reads it with GET /restapi/{version}/Policies/SecurityRules?name= and writes it with PUT only when the state changes, so repeated calls are idempotent. Commit to apply the change.
Get address
Get a address object by name with GET /restapi/{version}/Objects/Addresses?name=.
Get address group
Get a address group by name with GET /restapi/{version}/Objects/AddressGroups?name=.
Get job
Get a job (commit, push, content install) with the XML API operational command show jobs id. Returns normalized status, result, done, and succeeded fields.
Get security rule
Get a security rule by name with GET /restapi/{version}/Policies/${{ "SecurityPreRules" if inputs.rulebase == "pre" else ("SecurityPostRules" if inputs.rulebase == "post" else "SecurityRules") }}?name=.
Get system info
Get hostname, model, serial, PAN-OS version, and content versions with the XML API operational command show system info.
List address groups
List address groups with GET /restapi/{version}/Objects/AddressGroups.
List addresses
List address objects with GET /restapi/{version}/Objects/Addresses.
List device groups
List Panorama device groups and their member firewalls with the XML API operational command show devicegroups. Use the names as device_group with location device-group in object and security rule actions, and with commit_all.
List external dynamic lists
List external dynamic lists with GET /restapi/{version}/Objects/ExternalDynamicLists.
List managed firewalls
List firewalls managed by Panorama with the XML API operational command show devices all (or show devices connected). Returns serial, hostname, management IP, model, PAN-OS version, connection state, and the remaining API-native fields for each firewall.
List registered IPs
List IP addresses registered with tags for dynamic address groups with the XML API operational command show object registered-ip, optionally filtered by IP or tag.
List security rules
List security rules with GET /restapi/{version}/Policies/${{ "SecurityPreRules" if inputs.rulebase == "pre" else ("SecurityPostRules" if inputs.rulebase == "post" else "SecurityRules") }}.
List tags
List tags with GET /restapi/{version}/Objects/Tags.
List template stacks
List Panorama template stacks with the XML API (type=config, action=get) for /config/devices/entry[@name='localhost.localdomain']/template-stack. Returns each name, description, member templates (stacks only), and assigned firewall serial numbers.
List templates
List Panorama templates with the XML API (type=config, action=get) for /config/devices/entry[@name='localhost.localdomain']/template. Returns each name, description, member templates (stacks only), and assigned firewall serial numbers.
Move security rule
Move a security rule with POST /restapi/{version}/Policies/SecurityRules:move?where=&dst= (SecurityPreRules or SecurityPostRules on Panorama). Commit to apply the change.
Push template
Push template configuration from Panorama to its firewalls with the XML API (type=commit, action=all, commit-all template). Optionally limit the push to specific firewall serial numbers. Commit on Panorama first. Returns the job ID; use wait_for_job to wait for completion.
Push template stack
Push template stack configuration from Panorama to its firewalls with the XML API (type=commit, action=all, commit-all template-stack). Optionally limit the push to specific firewall serial numbers. Commit on Panorama first. Returns the job ID; use wait_for_job to wait for completion.
Push to device groups (Panorama)
Push committed Panorama configuration to the firewalls in one or more device groups with the XML API (type=commit, action=all, commit-all shared-policy). Optionally limit the push to specific firewall serial numbers. Commit on Panorama first. Returns the job ID; use wait_for_job to wait for completion.
Query logs
Search firewall or Panorama logs with the XML API log retrieval (type=log). Submits the query, polls the log job until it finishes, and returns the log entries.
Refresh external dynamic list
Refresh an external dynamic list now instead of waiting for its schedule, with the XML API operational command request system external-list refresh. Use after updating an EDL feed with new indicators.
Register IP tags
Tag IP addresses with the User-ID XML API (type=user-id, uid-message register) so dynamic address groups that match the tags pick them up without a commit. Set timeout for temporary containment; PAN-OS removes the tag when it expires.
Remove address group members
Remove members of a static address group in the candidate configuration. Reads the group with GET /restapi/{version}/Objects/AddressGroups?name= and writes it with PUT only when membership changes, so repeated calls are idempotent. Commit to apply the change.
Run operational command
Run an operational command with the XML API (type=op) and return the parsed response, e.g. <show><session><all><filter><source>203.0.113.10</source></filter></all></session></show>.
Test security policy match
Find the security rule that matches a traffic tuple with the XML API operational command test security-policy-match. Use it to confirm a block is effective or to explain why traffic was allowed.
Unblock FQDN
Unblock an FQDN blocked with the matching block action. Removes the address object from the static address group with PUT /restapi/{version}/Objects/AddressGroups if it is a member, then deletes the address object with DELETE /restapi/{version}/Objects/Addresses if it exists. Repeated calls are no-ops. Changes stay in the candidate configuration; run commit (and commit_all on Panorama) to enforce them.
Unblock IP
Unblock an IP address or CIDR range blocked with the matching block action. Removes the address object from the static address group with PUT /restapi/{version}/Objects/AddressGroups if it is a member, then deletes the address object with DELETE /restapi/{version}/Objects/Addresses if it exists. Repeated calls are no-ops. Changes stay in the candidate configuration; run commit (and commit_all on Panorama) to enforce them.
Unregister IP tags
Remove tags from IP addresses with the User-ID XML API (type=user-id, uid-message unregister), which removes them from dynamic address groups that match the tags.
Update address
Update a address object in the candidate configuration. Reads it with GET /restapi/{version}/Objects/Addresses?name=, applies only the provided fields, and writes it with PUT. Commit to apply the change.
Update security rule
Update a security rule in the candidate configuration. Reads it with GET /restapi/{version}/Policies/${{ "SecurityPreRules" if inputs.rulebase == "pre" else ("SecurityPostRules" if inputs.rulebase == "post" else "SecurityRules") }}?name=, applies only the provided fields, and writes it with PUT. Commit to apply the change.
Wait for job
Poll a job with the XML API operational command show jobs id until it finishes, then return normalized status, result, done, and succeeded fields. Fails when the job fails, unless raise_on_failure is false, or when it does not finish within poll_max_attempts.