- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
09-07-2021 06:22 PM - edited 09-07-2021 06:26 PM
We are in the process of renaming all our FW rules. I'd like to run a python script with Pan OS Python. The script would look at a CSV file where in column1 is the current name, column2 is the new name, and column3 is an Audit Comment. I'm able to do the first two tasks but can't for the life of me figure out how to tell python to find the name of a single rule. Anyone know how to tell python to pull in all Security Rules then tell it what rule name to look for. Once I have that I'm done with he code and would be happy to share if someone else is trying to do it this way.
09-30-2021 04:16 PM
There's an example script in the pan-os-python repo that shows how to retrieve all the security rules and checks the names for a particular one. This should be a good starting point:
https://github.com/PaloAltoNetworks/pan-os-python/blob/develop/examples/ensure_security_rule.py
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!