Skip to main content

A lightweight PanOS (Palo Alto Networks) Firewall Management utility.

Project description

EZPanOS

lightweight PAN-OS utility library focused on practical operational tasks.

Why ezpanos exists

ezpanos is not a replacement for Palo Alto Networks’ official SDKs.

It grew out of working directly with PAN-OS automation and seeing how often engineers still end up dealing with hardcoded XPath, XML-heavy responses, and task-specific parsing logic.

ezpanos exists to make that experience more practical.

The PAN-OS ecosystem exposes strong configuration and object-management primitives, but real-world automation often needs more than object CRUD:

  • intuitive command execution
  • JSON-normalized output
  • Multi-device and Panorama-oriented workflows

The goal is to make operational automation easier to build, read, and reuse.

Installation

pip install ezpanos

Quick Start

from ezpanos import EzPanOS

endpoint = "10.0.0.1"
fw = EzPanOS(endpoint=endpoint, username="admin")
print(fw.execute("show system info"))

If password is omitted, you are securely prompted. Credentials entered once can be reused in-memory for subsequent connections in the same run.

Config Profiles

You can use a config.json file for endpoint/profile organization and optional usernames/passwords.

Conceptually, an estate is the firewalls you intend to manage. Because the utility works on many PanOS Configuration types: Panorama, Firewall, or Log Collector: each can be assimilated into this framework.

Example config.json:

{
  "profiles": {
    "estate": {
      "username": "svc_firewall",
      "endpoints": [
        {"endpoint": "firewall-1.inside.example.com"},
        {"endpoint": "firewall-2.inside.example.com"}
      ]
    }
  }
}

Build instances:

from ezpanos import EzPanOS

instances = EzPanOS.instances_from_config_profile(
    config_path="config.json",
    config_profile="estate",
)

Note that the name of the config_profile is estate, this is configurable if you intend to logically separate the management of different such estates. This is useful for environments with multiple Panorama Instances.

If passwords are not present in config, you will be prompted and values are reused from in-memory cache where possible.

Rule Management

from ezpanos import EzPanOS

fw = EzPanOS(endpoint="10.0.0.1", username="admin")
result = fw.create_security_rule(
    rule_name="example-rule",
    from_zones=["trust"],
    to_zones=["untrust"],
    sources=["any"],
    destinations=["any"],
    applications=["web-browsing"],
    services=["application-default"],
    action="allow",
)
print(result)

Delete rule and commit:

delete_result = fw.delete_security_rule("example-rule", ignore_missing=True)
print(delete_result)

commit_result = fw.commit(wait_for_job=True)
print(commit_result)

Job sensitive commands

Some commands like software download/install as well as standard commit jobs execute beyond the xml command success.

To monitor the job id of an executed command:

response = fw.execute("request sustem software check")
job_id = fw.extract_job_id(response)

# Or likewise:

version = "10.1.1"
response = fw.execute(f"request sustem software download version: {version}")
job_id = fw.extract_job_id(response)

This job can then be monitored with
response = fw.execute(f"show jobs id {job_id}")

Experimental: Intent-Driven Policy Engineering

ezpanos is also exploring an intent-driven workflow layer for policy operations.

Operators often know the connection requirements they need, but translating that requirement into environment-aware implementations across an estate of devices and security zones is tedious and error-prone.

The experimental workflow uses natural language for intent capture, while keeping execution deterministic and reviewable.

Design principles:

  • intent in, ruleset out
  • deterministic resolution of implementation details
  • bounded execution paths
  • explicit operator review before commission
  • no unrestricted autonomous environment mutation

This functionality is currently gated while the workflow model is hardened and validated.

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-1.0.2.tar.gz (34.8 kB view details)

Uploaded Source

Built Distribution

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

ezpanos-1.0.2-py3-none-any.whl (30.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ezpanos-1.0.2.tar.gz
  • Upload date:
  • Size: 34.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for ezpanos-1.0.2.tar.gz
Algorithm Hash digest
SHA256 f41fda9185b84a8f908e7d37d6031b3d3cb7188459a33a4b46afd4e9035f2d59
MD5 c0fcb40d3a3f18b67a6a4ccbc47a11c3
BLAKE2b-256 e3161818912e99423c2f03e9b34fe9247684a155c4744245272e0a264c413ad8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ezpanos-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 30.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for ezpanos-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6cb660a645d0533089917bb2b2b6ef4f85623e94a681c39e713acf2ae118a5cc
MD5 362fe60f9bfdd1133273a490de941d19
BLAKE2b-256 931c0122d9ca7b03b342b95f9a8bdbbd2de8d530e2b0e264256ce73d1cf38c41

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