cdot65 / pan-os-upgrade

An efficient tool to execute configuration backups, network state snapshots, system readiness checks, and operating system upgrades of Palo Alto Networks firewalls and Panorama appliances.
https://cdot65.github.io/pan-os-upgrade/
Apache License 2.0
39 stars 7 forks source link

Avoid user lockout situations when using an external authentication service #124

Open cdot65 opened 4 months ago

cdot65 commented 4 months ago

Is your feature request related to a problem? Please describe.

After upgrading a PAN-OS firewall using the pan-os-upgrade utility, the user credentials may take some time to become available if an external authentication service is used. This delay can cause the utility to repeatedly attempt to log in, resulting in the user's account being locked out after a certain number of failed attempts. The current approach of relying solely on user credentials for post-upgrade verification can lead to unnecessary lockouts and inconvenience for users.

Describe the solution you'd like

Enhance the pan-os-upgrade utility to offer an alternative approach for checking the status of an upgraded firewall by leveraging the HA (High Availability) status information from the peer firewall, if available. The utility should:

  1. Detect if the upgraded firewall is part of an HA pair.
  2. If an HA peer is detected, retrieve the HA status information from the peer firewall after the upgrade process is completed.
  3. Analyze the HA status to determine if the upgraded firewall has successfully rejoined the HA cluster and is functioning properly.
  4. If the HA status indicates a successful upgrade, consider the upgrade process as completed and avoid relying on user credentials for further verification.
  5. If no HA peer is detected or if the HA status check fails, fall back to the existing approach of using user credentials for post-upgrade verification.

Describe alternatives you've considered

An alternative approach could be to introduce a configurable delay or retry mechanism when using user credentials for post-upgrade verification. This would allow the utility to wait for a specified period or number of attempts before considering the upgrade process as failed. However, this approach might still lead to account lockouts if the external authentication service takes longer than expected to become available.

Additional context

Here are a few additional points to consider:

By implementing this feature, the pan-os-upgrade utility will provide a more reliable and efficient way to verify the status of upgraded firewalls, minimizing the chances of user account lockouts and improving the overall upgrade experience.