Author Archives: cyruslab

[python]Working with Palo Alto firewall API with pan-python module

This is another demonstration on the use of pan-python module. The usage documentation can be found in github. This is a simple demonstration on using the pan.xapi module from pan-python. Only changes the device configuration time settings. The demo uses … Continue reading

Posted in Python, Scripting | Tagged , , | Leave a comment

[python]working with pan-python module. Module that calls Palo Alto API

I found the example of usage in here. The code will not work on python3. In fact i am not sure why the print(credentials) in the code is necessary, there is no arg passed into the PanXapi which puzzles me … Continue reading

Posted in Python, Scripting | Tagged | Leave a comment

[python]Create firewall objects with Palo Alto API

This is a code example to demonstrate the use of Palo Alto API. Suppose I need to create pool.ntp.org firewall objects. Here’s the code sample: The result look like this:

Posted in Python, Scripting | Tagged , , | Leave a comment

[python]Create and update object groups

I am experimenting a real life example, when server is created the hostname and ip address are assigned by an orchestrator. The orchestrator will then call the python script and pass the hostname to be object entry name and ip … Continue reading

Posted in Python, Scripting | Tagged , | Leave a comment

[python]Trying the operation command api in Palo Alto Firewall

This code sample uses requests and beautifulsoup4 modules to manipulate data extracted with PA’s REST API. PA only supports xml though. The requests is to use the GET method when calling REST API, the beautifulsoup4 is to easily extract the … Continue reading

Posted in Python, Scripting | Tagged , , | Leave a comment

[Powershell]Obfuscate password

This is a sample script to create a password file, the file is encrypted, however when you need to read from the files you can use it for your script to authenticate so that your script do not need to … Continue reading

Posted in Powershell, Scripting | Tagged , | Leave a comment

[Powershell]Concatenate XML blocks base on a list

So on previous post i have posted an entire code to build standard firewalls for new servers. So basically there is a small function that does the trick. The idea is that I do not want the orchestrator to send … Continue reading

Posted in Powershell, Scripting | Tagged | Leave a comment