Skip to main content

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.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.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.ezpanos import PanOS

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.ezpanos import PanOS
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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ezpanos-0.2.3.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ezpanos-0.2.3-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file ezpanos-0.2.3.tar.gz.

File metadata

  • Download URL: ezpanos-0.2.3.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

Hashes for ezpanos-0.2.3.tar.gz
Algorithm Hash digest
SHA256 864dd44ab3cf761d4e8d9cffffdf326124658b1b630d1e0bfce35e1215bca1a7
MD5 ae7fbd8439c85f4f2aceed8173ed68c7
BLAKE2b-256 917d124bd909c647a0bdd6396b5c67f95b50a94e52699868bb37da067c99def6

See more details on using hashes here.

File details

Details for the file ezpanos-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: ezpanos-0.2.3-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

Hashes for ezpanos-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3e184a1b5ab304885f2b997e51418aa1e0dd2219b769f1a74a9af5e62375b399
MD5 61412bb5655ba90a5fb5a11a0c67a27c
BLAKE2b-256 1638ec84d8a1be4aa104f77e521104c8fc4d9b07686539091cd721c9698cc9eb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page