From 9882d534af8a826b72e41643e91e1e020f64fa41 Mon Sep 17 00:00:00 2001 From: Antoni Company Date: Mon, 20 Apr 2026 10:28:17 +0100 Subject: [PATCH] fix: commit overhaul (#6915) - Removed scope exclusion for "standard commit". - If 'device-and-networks' is excluded (previous behaviour), a certificate for Panorama (always outside of a template) will not be committed (imported to the config but never applied to Panorama). Therefore, panos.sh was only working for certificates used in templates and applied to devices, but not for the Panorama certificate itself. - According to the official documentation and the XML API Browser, there is no 'policy-and-objects' that can be excluded. - Although it is not mandatory that the user account is solely dedicated to replace certificates and to perform no other type of operations, it is recommended. If such recommendation is applied, the only changes being committed would be in relation to certificates. Therefore, it should be safe not to exclude any scopes. - Changed the order for "force commit" from '' (unofficial) to '' (official). Both work, but it is recommended to use what is part of the official documentation and/or XML API Browser. - Removed unofficial 'policy-and-objects' from commented out code (see above). - Replaced 'exclude' with 'excluded' from commented out code, as per the official documentation. Both work, but see above. - Replaced 'acmekeytest' with $_panos_user in the commented out code. Official documentation: https://docs.paloaltonetworks.com/ngfw/api/pan-os-xml-api-request-types-and-actions/commit XML API Browser: https:///api --- deploy/panos.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/deploy/panos.sh b/deploy/panos.sh index 019d8c62..00badffc 100644 --- a/deploy/panos.sh +++ b/deploy/panos.sh @@ -68,8 +68,8 @@ deployer() { # Get Version Info to test key content="type=version&key=$_panos_key" ## Exclude all scopes for the empty commit - #_exclude_scope="excludeexcludeexclude" - #content="type=commit&action=partial&key=$_panos_key&cmd=$_exclude_scopeacmekeytest" + #_exclude_scope="excludedexcluded" + #content="type=commit&action=partial&key=$_panos_key&cmd=$_exclude_scope$_panos_user" fi # Generate API Key @@ -128,10 +128,9 @@ deployer() { #Check for force commit - will commit ALL uncommited changes to the firewall. Use with caution! if [ "$FORCE" ]; then _debug "Force switch detected. Committing ALL changes to the firewall." - cmd=$(printf "%s" "$_panos_user" | _url_encode) + cmd=$(printf "%s" "$_panos_user" | _url_encode) else - _exclude_scope="excludeexclude" - cmd=$(printf "%s" "$_exclude_scope$_panos_user" | _url_encode) + cmd=$(printf "%s" "$_panos_user" | _url_encode) fi content="type=commit&action=partial&key=$_panos_key&cmd=$cmd" fi