Skip to main content

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

Reason this release was yanked:

typo :<

Project description

EZPanOS

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

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)

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.8.tar.gz (32.1 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.8-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ezpanos-0.2.8.tar.gz
Algorithm Hash digest
SHA256 5b023178f71adec1c2f371bf9c8cf75cf2733c986b7e5addb8443e812da1f4f4
MD5 10d281774177d62bc38df2169f579900
BLAKE2b-256 9482c1f8602cede8c02ce4518de98cd645fe8ce5df83b855872ef8c1c1a35812

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ezpanos-0.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 b3c2481fb881142578f240e171728e70a0c3dce56137b79ba0840d5ef79b6182
MD5 b3fe16245a07fb1acb4424d48fd809e5
BLAKE2b-256 12a5fac190c8313504700f09f12857208d05510774fd440ac3a614e6735bdbb4

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