how to export security policy in json format

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to export security policy in json format

L0 Member

Is their any why to  export Panorama managed security Policies in JSON file

1 accepted solution

Accepted Solutions

Cyber Elite
Cyber Elite

Hi @sshivanandap ,

 

The most simple way to "export" the security policy in JSON format is to run the command "show rulebase security" in CLI configuration mode and copy the response.

 

If you need to retrieve the security policy more than once, you can automate it with the REST API and also get the response in JSON format.  https://docs.paloaltonetworks.com/pan-os/9-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-ap...

 

The PAN-OS GUI is a human interface, and CSV and PDF are human-readable formats.  The PAN-OS API (XML and REST) is a machine interface, and support machine-readable formats or XML and JSON.  The reason that you want the format in JSON is most likely to run some type of automation against it.  (I could be wrong.)  If you are going to run automation against the data, you might as well automate the retrieval of the data.

 

Thanks,

 

Tom

Help the community: Like helpful comments and mark solutions.

View solution in original post

2 REPLIES 2

L1 Bithead

As far as I know, there is no way of exporting the policies as JSON. The supported data formats are CSV and PDF.

 

I would recommend to you to export the data as CSV files and convert it to JSON afterwards. There are many ways to archive that but I would avoid online tools since we don't know what they do with the uploaded data. As an alternative, you could create a little Python/Node.js Script or do the convertion directly in Excel (using Typescript).

 

Hope that helps a bit and I wish you good luck with your project!

Cyber Elite
Cyber Elite

Hi @sshivanandap ,

 

The most simple way to "export" the security policy in JSON format is to run the command "show rulebase security" in CLI configuration mode and copy the response.

 

If you need to retrieve the security policy more than once, you can automate it with the REST API and also get the response in JSON format.  https://docs.paloaltonetworks.com/pan-os/9-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-ap...

 

The PAN-OS GUI is a human interface, and CSV and PDF are human-readable formats.  The PAN-OS API (XML and REST) is a machine interface, and support machine-readable formats or XML and JSON.  The reason that you want the format in JSON is most likely to run some type of automation against it.  (I could be wrong.)  If you are going to run automation against the data, you might as well automate the retrieval of the data.

 

Thanks,

 

Tom

Help the community: Like helpful comments and mark solutions.
  • 1 accepted solution
  • 2761 Views
  • 2 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!