Interface full_delete fails if static route references any other interface
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- networking
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 402
- Fork
- 199
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PaloAltoNetworks/pan-os-python
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
PaloAltoNetworks/pan-os-python#624 · 1 commento ·
-
Security: xml.etree.ElementTree used across 10 core modules — no XXE protectionForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
PaloAltoNetworks/pan-os-python#617 · 2 commenti ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
Tutte le issue di PaloAltoNetworks/pan-os-python
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
huggingface/smolagents#3106 ·
I maintainer di solito rispondono entro 2 giorni
-
area:scripts area:tests bug priority:later
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Ikalus1988/MisakaNet#4358 ·
I maintainer di solito rispondono entro 1 giorno
-
Discovered ports from service discovery are never propagated to modules in Module.load()Forse già presa @vishalmore90 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
OWASP/Nettacker#1828 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
aws-samples/sample-per-model-bedrock#708 ·
I maintainer di solito rispondono entro 1 giorno
-
maintenance
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100