How to export Firewall security policy rules into a readable spreadsheet format using XML API?

How to export Firewall security policy rules into a readable spreadsheet format using XML API?

55667
Created On 12/20/19 02:46 AM - Last Modified 05/17/23 07:35 AM


Objective


To Export Palo Alto Firewall rules into a readable spreadsheet format using XML API.

Environment


  • Palo Alto Firewall.
  • PAN-OS 7.1 and above.


Procedure


  1. Generate the key in order to export rules.
http(s)://hostname/api/?type=keygen&user=username&password=password
  • Replace the hostname, username and password with the Firewall IP address, administrator username and password. Note down the generated Key.
  1. To import Security Rules, API should look like the one below:
https://hostname/api/?type=config&action=get&xpath=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/rulebase/security&key=LUFRPT14MW5xOEo1R09KVlBZ
  • Replace the 'hostname' with Firewall IP address.
  • Replace the 'key' (LUFRPT14MW5xOEo1R09KVlBZ) with the one  generated in Step 1.
  1. Once you have corrected the API call, copy the complete call.
  2. Open excel, click on Data  and  Click on 'From web'
  3. Under the address field, enter the API call and click on 'GO'
  4. Configuration should appear in XML format. Click on 'Import'
  5. Configuration should get imported in to excel. 


Additional Information


In PAN-OS 8.1 and above, the firewall rules can be exported into a PDF/CSV format directly from the policy tab. Refer New features Guide for more details.

Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000PNvDCAW&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail