PaloAltoNetworks / pan-os-python

The PAN-OS SDK for Python is a package to help interact with Palo Alto Networks devices (including physical and virtualized Next-generation Firewalls and Panorama). The pan-os-python SDK is object oriented and mimics the traditional interaction with the device via the GUI or CLI/API.
https://pan-os-python.readthedocs.io
ISC License
347 stars 172 forks source link

But how to obtain the rule of source IP #575

Open Manchuker1120 opened 1 month ago

Manchuker1120 commented 1 month ago

How to extract the rules in a specific fw on Panorama

Manchuker1120 commented 1 month ago

fw = Firewall("10.140.196.132", "admin", "Sx[00]Wg(00)") rulebase = fw.add(Rulebase()) q = {'destination': ['3.2.2.2'],} rulebase.add(SecurityRule(**q)) fw.add(rulebase) rules = SecurityRule.refreshall(rulebase) for rule in rules: pprint(rule.about())

it donse't work