Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address Unused Recursive Filter issue #791

Open
erickfcc opened this issue Oct 29, 2024 · 2 comments
Open

Address Unused Recursive Filter issue #791

erickfcc opened this issue Oct 29, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@erickfcc
Copy link

erickfcc commented Oct 29, 2024

Describe the bug

When running the following
pan-os-php type=address in=api://IP actions=display/delete 'filter=(object is.unused.recursive)'

The "unused" objects being filtered are actually being used

Expected behavior

Can this filter work to make sure these objects are not referenced anywhere in the XML?

Current behavior

Unused filters not showing used in Network / Interface section

Possible solution

N/A

Steps to reproduce

  1. Create an address object
  2. Add that object to an interface as an IP
  3. Run the filter to search for unused objects and the delete action

Screenshots

* ** ERROR ** * API reported a failure: "error" with the following addition infos:   vl794 cds gw 100.106.32.1 cannot be deleted because of references from: network -> interface -> ethernet -> ethernet1/4 -> layer3 -> units -> ethernet1/4.794 -> ip -> vl794 cds gw 100.106.32.1 network -> interface -> ethernet -> ethernet1/4 -> layer3 -> units -> ethernet1/4.794 -> ip -> vl794 cds gw 100.106.32.1

 *** Backtrace ***
0 ****
       backtrace_print()
       ::/tools/pan-os-php/lib/pan_php_framework.php line 631
1 ****
       derr()
       ::/tools/pan-os-php/lib/misc-classes/PanAPIConnector.php line 1319
2 ****
   PanAPIConnector:192.255.54.61
       PanAPIConnector::sendRequest() @
           /tools/pan-os-php/lib/misc-classes/PanAPIConnector.php line 1950
3 ****
   PanAPIConnector:192.255.54.61
       PanAPIConnector::sendDeleteRequest() @
           /tools/pan-os-php/lib/object-classes/AddressStore.php line 627
4 ****
   PANConf: / VirtualSystem:vsys1 / AddressStore:addresses
       AddressStore::API_remove() @
           /tools/pan-os-php/utils/common/actions-address.php line 82
5 ****
       {closure}()
       ::/tools/pan-os-php/utils/common/CallContext.php line 116
6 ****
   Action:'delete'
       CallContext::executeAction() @
           /tools/pan-os-php/utils/lib/UTIL.php line 1976
7 ****
       UTIL::time_to_process_objects() @
           /tools/pan-os-php/utils/lib/UTIL.php line 231
8 ****
       UTIL::utilStart() @
           /tools/pan-os-php/utils/lib/UTIL.php line 215
9 ****
       UTIL::__construct() @
           /tools/pan-os-php/lib/misc-classes/PH.php line 1207
10 ****
       callPANOSPHP()
       ::/tools/pan-os-php/utils/pan-os-php.php line 118
11 ****
       require_once()
       ::Command line code line 1

## Context

Your Environment

  • Version used:
  • Environment name and version (e.g. Chrome 59, node.js 5.4, python 3.7.3):
  • Operating System and version (desktop or mobile):
  • Link to your project:
@erickfcc erickfcc added the bug Something isn't working label Oct 29, 2024
@swaschkut
Copy link
Contributor

thanks for mentioning this bug:
it is still the same as:
#764

Which is not fixed since a long time.
No clue when I can bring in better validation for all this Panorama template stuff, which also differ if they are used directly in Firewall

@swaschkut
Copy link
Contributor

swaschkut commented Jan 6, 2025

Hey Erick,

there is a new Docker develop Container available, which should address your issue:

docker pull swaschkut/pan-os-php:develop
docker run --name panosphp --rm -v ${PWD}:/share -it swaschkut/pan-os-php:develop

if you can validate this by running:

pan-os-php type=address in=config_file.xml actions=displayreferences location=any 'filter=(name regex /vl794 cds gw 100.106.32.1/)'

and check if there is an output something like:
"references by ethernet1/4.794"

Please send me feedback about your validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants