- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
Enhanced Security Measures in Place: To ensure a safer experience, we’ve implemented additional, temporary security measures for all users.
09-25-2023 12:58 AM
Is their any why to export Panorama managed security Policies in JSON file
09-25-2023 04:19 AM
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
09-25-2023 03:02 AM
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!
09-25-2023 04:19 AM
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
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!