Author Archives: cyruslab

[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: Advertisements

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

[Powershell]Submitting access request to tufin

Background So here is a real life requirement that when vRealize Orchestrator created a new virtual machine, the ip addresses of the new VM are passed over to a list, another script will be triggered weekly to read from the … Continue reading

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

Compare-Object: Find item in file 1 that is not in file2

The objective is to compare two files, one reference list the other is the testing list. My colleague helped me wrote a script to do the comparison, there were many false positives, so here’s his script: The output always give … Continue reading

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