PaloAltoNetworks/pan-os-php

Bug-02-may-2023-1 ResolveServiceSummary doesn't work with ruletype=nat

nexusops opened this issue · 2 comments

Describe the bug

When performing "exporttoexcel" action and using "ResolveServiceSummary" optional argument, the script ends with an error. Exporttoexcel action works fine without the ResolveServiceSummary. ResolveAddressSummary also works fine.

Expected behavior

Service objects should be resolved, the same way how the export works for security rules

Current behavior

scripts ends with error

Possible solution

Service objects should be resolved, the same way how the export works for security rules

Steps to reproduce

  1. run the following command pan-os-php type=rule ruletype=nat in=[CONFIG-FILE] location=[LOCATION] 'actions=exporttoexcel:test-export-service.xls,ResolveServiceSummary'

  2. The following error is produced

    • action 'exportToExcel' has tasks to process before shutdown.
  • ** ERROR ** * Died on user notice or warning!! Error: Attempt to read property "o" on null on /tools/pan-os-php/utils/common/RuleCallContext.php:655

*** Backtrace ***
0 ****
backtrace_print()
::/tools/pan-os-php/lib/pan_php_framework.php line 609
1 ****
derr()
::/tools/pan-os-php/lib/pan_php_framework.php line 117
2 ****
myErrorHandler()
::/tools/pan-os-php/utils/common/RuleCallContext.php line 655
3 ****
Action:'exportToExcel' / Args: filename=test-export-service.xls, additionalFields=ResolveServiceSummary,
RuleCallContext::ServiceCount() @
/tools/pan-os-php/utils/common/RuleCallContext.php line 382
4 ****
Action:'exportToExcel' / Args: filename=test-export-service.xls, additionalFields=ResolveServiceSummary,
RuleCallContext::ruleFieldHtmlExport() @
/tools/pan-os-php/utils/common/actions-rule.php line 4347
5 ****
{closure}()
::/tools/pan-os-php/utils/common/CallContext.php line 127
6 ****
Action:'exportToExcel' / Args: filename=test-export-service.xls, additionalFields=ResolveServiceSummary,
CallContext::executeGlobalFinishAction() @
/tools/pan-os-php/utils/lib/UTIL.php line 1769
7 ****
UTIL::GlobalFinishAction() @
/tools/pan-os-php/utils/lib/RULEUTIL.php line 39
8 ****
RULEUTIL::utilStart() @
/tools/pan-os-php/utils/lib/UTIL.php line 207
9 ****
UTIL::__construct() @
/tools/pan-os-php/lib/misc-classes/PH.php line 997
10 ****
callPANOSPHP()
::/tools/pan-os-php/utils/pan-os-php.php line 117
11 ****
require_once()
::Command line code line 1
root@262f77be1a36:/share#

  • Version used:

  • root@262f77be1a36:/share# pan-os-php version

  • PAN-OS-PHP version: 2.1.2 [UNIX]

  • /tools/pan-os-php/utils

  • PHP version: 8.1.2-1ubuntu2.11
    root@262f77be1a36:/share#

this will be resolved in version 2.1.3
develop version has this already fixed

introduce with #747