A lightweight PanOS (Palo Alto Netoworks) firewall Management utility.
Project description
EZPanos
An Ergonomic and lightweight PanOS Utility Library
Installation
pip install ezpanos
Quick Start
You may provide a username and password, or an API key.
If the username and password parameters are not populated without an API key, you will be prompted for them.
from ezpanos import EzPanOS
import getpass
creds = {
"username": input("Username: "),
"password": getpass.getpass("Password: ")
}
endpoint = "<Management interface IP"
connection = EzPanOS(endpoint, username=creds["username"], password=creds["password"])
print(connection.execute("show system info"))
Using an API token
By default, the EzPanOS class will use username/password to generate an authentication token from PanOS. This can however, be overridden if you already have it.
from ezpanos import EzPanOS
endpoint = "x.x.x.x"
connection = EzPanOS(endpoint, api_key="xxxxxxxxxxxx")
print(connection.execute("show system info"))
Retrieving a Device Configuration:
Warning: Each configuration can exceed 80+Mb each. Be mindful of memory leaks.
Memory utilization has been optimized during configuration retrieval using streaming output and tempfile utilization.
configuration_dictionary = connection.get_configuration()
Saving a Device Configuration to Disk
To save a configuration to a file, use the export_configuration method.
from ezpanos import EzPanOS
endpoint = "x.x.x.x"
# or username/password outlined above
connection = EzPanOS(endpoint, api_key="xxxxxxxxxxxx")
connection.export_configuration(output_filename="my_panos_configuration.json")
# if output_filename is null, default is:
# ./<endpoint_name>_yyy:mm:dd_hh:mm:ss.json
Getting the entire Device Configuration as a dictionary
for random access to a particular configuration item in the configuration, ruleset, network, interfaces, etc. Use the get_configuration method.
from ezpanos import EzPanOS
from getpass import getpass
endpoint = "x.x.x.x"
# do NOT use this method on an untrusted system.
connection = EzPanOS(endpoint, username="user", password=getpass(f"Password: "))
configuration = connection.get_configration()
Currently an ideal platform for executing arbitrary PanOS commands against firewalls and Panorama instances for a wide variety of use cases.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ezpanos-0.2.5.tar.gz.
File metadata
- Download URL: ezpanos-0.2.5.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e39abeee9ccd9a3e38dc0ef5f3e3fe777972f48c364c81c14fdc3be6f78051d1
|
|
| MD5 |
3b1b8604ab1566c18a269f3da413da5f
|
|
| BLAKE2b-256 |
941c396ea64eb58ef4d1bb29e1cc6ba328a7a28e3f588811a820599e27b7ef42
|
File details
Details for the file ezpanos-0.2.5-py3-none-any.whl.
File metadata
- Download URL: ezpanos-0.2.5-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2566cff513c72a61f031f04c0239712979357cdaf4fdd49fb2c6e40b494d7ee0
|
|
| MD5 |
0838b6d94d948a210d23e46a29e307e3
|
|
| BLAKE2b-256 |
d8101bb4a26b5a64e77e0fc70c1abb0c7aea9b2460d7e098dd3a4402711760e2
|