百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

pan-os-python

> 编程语言
开源

用于 Python 的 PAN-OS SDK 是一个用于帮助与 Palo Alto Networks 设备(包括物理和虚拟化的下一代防火墙和 Panora)进行交互的包。

397 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

用于 Python 的 PAN-OS SDK 是一个用于帮助与 Palo Alto Networks 设备(包括物理和虚拟化的下一代防火墙和 Panora)进行交互的包。

Palo Alto Networks PAN-OS SDK for Python

The PAN-OS SDK for Python (pan-os-python) is a package to help interact with Palo Alto Networks devices (including physical and virtualized Next-generation Firewalls and Panorama). The pan-os-python SDK is object oriented and mimics the traditional interaction with the device via the GUI or CLI/API.

  • Documentation: http://pan-os-python.readthedocs.io


Features

  • Object model of Firewall and Panorama configuration
  • Multiple connection methods including Panorama as a proxy
  • All operations natively vsys-aware
  • Support for high availability pairs and retry/recovery during node failure
  • Batch User-ID operations
  • Device API exception classification

Status

Palo Alto Networks PAN-OS SDK for Python is considered stable. It is fully tested and used in many production environments. Semantic versioning is applied to indicate bug fixes, new features, and breaking changes in each version.

Install

Install using pip:

bash
pip install pan-os-python

Upgrade to the latest version:

bash
pip install --upgrade pan-os-python

If you have poetry installed, you can also add pan-os-python to your project:

bash
poetry add pan-os-python

How to import

To use pan-os-python in a project:

python
import panos

You can also be more specific about which modules you want to import:

python
from panos import firewall
from panos import network

A few examples

For configuration tasks, create a tree structure using the classes in each module. Nodes hierarchy must follow the model in the Configuration Tree.

The following examples assume the modules were imported as such:

python
from panos import firewall
from panos import network

Create an interface and commit:

python
fw = firewall.Firewall("10.0.0.1", api_username="admin", api_password="admin")
eth1 = network.EthernetInterface("ethernet1/1", mode="layer3")
fw.add(eth1)
eth1.create()
fw.commit()

Operational commands leverage the 'op' method of the device:

python
fw = firewall.Firewall("10.0.0.1", api_username="admin", api_password="admin")
print fw.op("show system info")

Some operational commands have methods to refresh the variables in an object:

python
# populates the version, serial, and model variables from the live device
fw.refresh_system_info()

See more examples in the Usage Guide.

Upgrade from pandevice

This pan-os-python package is the evolution of the older pandevice package. To upgrade from pandevice to pan-os-python, follow these steps.

Step 1. Ensure you are using python3

Python2 is end-of-life and not supported by pan-os-python.

Step 2. Uninstall pandevice:

bash
pip uninstall pandevice
 # or
poetry remove pandevice

Step 3. Install pan-os-python:

bash
pip3 install pan-os-python
 # or
poetry add pan-os-python

Step 4. Change the import statements in your code from pandevice to panos. For example:

python
import pandevice
from pandevice.firewall import Firewall

 # would change to

import panos
from panos.firewall import Firewall

Step 5. Test your script or application

There are no known breaking changes between pandevice v0.14.0 and pan-os-python v1.0.0, but it is a major upgrade so please verify everything works as expected.

Contributors

  • Brian Torres-Gil - btorresgil
  • Garfield Freeman - shinmog
  • John Anderson - lampwins
  • Aditya Sripal - AdityaSripal

Thank you to Kevin Steves, creator of the pan-python library

Issues· 110 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Pythonfeaturedfirewallfirewall-configurationhacktoberfest

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言