Interface full_delete fails if static route references any other interface
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 52/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- networking
Hướng nghiên cứu
Start in panos/network.py at full_delete(), especially line 595, and inspect how StaticRoute stores its interface attribute compared with objects such as VirtualRouter or Zone. Run the minimal reproduction from the issue without a live firewall. Done means ethernet2.full_delete() completes without raising the TypeError when an unrelated StaticRoute references ethernet1/1.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
If a static route exists on the firewall which references an interface, a full_delete() will fail on a different interface.
Expected behavior
full_delete() should complete without throwing an exception
Current behavior
A TypeError exception is thrown, such as:
File "/work/panos/network.py", line 595, in full_delete
elif "__iter__" in dir(obj.interface) and self in obj.interface:
TypeError: 'in ' requires string as left operand, not EthernetInterface
Possible solution
StaticRoute's interface attribute gets populated as a string, whereas the full_delete code appears to expect a list (which is the case for other objects such as VirtualRouter or Zone). Since the str type will also pass the __iter__ check, a more specific type check may be needed to avoid the in test that results at network.py:595.
Steps to reproduce
Minimal pan-os-python reproduction without a live firewall (StaticRoute is being added directly to Firewall for brevity but error still triggers with VirtualRouter):
from panos.network import EthernetInterface, StaticRoute
from panos.firewall import Firewall
firewall = Firewall()
ethernet1 = firewall.add(EthernetInterface("ethernet1/1", mode="layer3"))
ethernet2 = firewall.add(EthernetInterface("ethernet1/2", mode="layer3"))
route = firewall.add(StaticRoute("test", interface="ethernet1/1"))
ethernet2.full_delete() # generates error
Context
This can be a really tricky situation to avoid since the StaticRoute that triggers the error is unrelated to the interface being changed. Routes targeted at interfaces rather than next-hops can be common in environments with IPSec tunnels, but the interface can also be present in addition to a next-hop for any static route.
Your Environment
Python 3.9.15
pan-os-python 1.7.3
- Ngôn ngữ chính
- Python
- Star
- 402
- Fork
- 199
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PaloAltoNetworks/pan-os-python
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
PaloAltoNetworks/pan-os-python#624 · 1 bình luận ·
-
Security: xml.etree.ElementTree used across 10 core modules — no XXE protectionCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
PaloAltoNetworks/pan-os-python#617 · 2 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
-
Feature/Zone Protection ProfilesĐang mởenhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Tất cả issue của PaloAltoNetworks/pan-os-python
Issue tương tự
-
URLValidator ignores an explicit empty scheme allowlistCó thể đã có người làm @IlyaKhalafi đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
tortoise/tortoise-orm#2393 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
frappe/frappe_docker#2046 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Weekly link check failedĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
complete_box_iou_loss / complete_box_iou: NaN gradients for zero-height boxes, NaN for point boxesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
AXI SMU SPEC
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
tenstorrent/tt-oca-harness#3556 ·
Maintainer thường phản hồi trong vòng 1 ngày