Skip to content

custom scripting

Sven Waschkut edited this page Feb 12, 2022 · 2 revisions

You like to write your own script to taggle Palo Alto Networks Firewall or Panorama configuration:

use this scripting template

https://github.com/PaloAltoNetworks/pan-os-php/blob/main/examples/template-for-your-own-scripts.php

example of full own script compare to extend predefined UTIL script with a PLUGIN

  • here is an example of a full own written script:

php /[fullpath]/pan-os-php/examples/example-display-rules-source-destination.php in=api://MGMT-IP

https://github.com/PaloAltoNetworks/pan-os-php/blob/main/examples/example-display-rules-source-destination.php

  • The above functionality can also be written in a PLUGIN, to extend available UTIL script:

pan-os-php type=rule loadplugin=/[fullpath]/pan-os-php/examples/example_plugin_rule_display_source_destination.php] actions=example_plugin_source_destination in=api://MGMT-IP

https://github.com/PaloAltoNetworks/pan-os-php/blob/main/examples/example_plugin_rule_display_source_destination.php