Skip to content

Commit

Permalink
Merge pull request #68 from cdot65/67-implement-post-upgrade-snapshot…
Browse files Browse the repository at this point in the history
…s-and-configuration-backups-with-diff-support

Enhance Upgrade Workflow with Post-Upgrade Snapshots, Configuration Backups, and Diff Support
  • Loading branch information
cdot65 authored Feb 4, 2024
2 parents dbb79e0 + 2402cc6 commit fbcb5f8
Show file tree
Hide file tree
Showing 12 changed files with 2,451 additions and 1,498 deletions.
252 changes: 168 additions & 84 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ WORKDIR /app
ADD settings.yaml /app

# Install any needed packages specified in requirements.txt
# Note: The requirements.txt should contain pan-os-upgrade==1.0.0
RUN pip install --no-cache-dir pan-os-upgrade==1.0.0
# Note: The requirements.txt should contain pan-os-upgrade==1.1.0
RUN pip install --no-cache-dir pan-os-upgrade==1.1.0

# Set the locale to avoid issues with emoji rendering
ENV LANG C.UTF-8
Expand Down
15 changes: 15 additions & 0 deletions docs/about/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,25 @@

Welcome to the release notes for the `pan-os-upgrade` tool. This document provides a detailed record of changes, enhancements, and fixes in each version of the tool.

## Version 1.1.0

**Release Date:** *<20240204>*

### What's New

- Pre/Post upgrade diff report created in PDF format
- Changed structure of AssuranceOptions
- `enabled_by_default` key added to allow for declaring which tests will execute by default
- Introduced "skipped" emoji to bring awareness to which tests and checks are skipped
- Using custom fork for `panos-upgrade-assurance` to account for integer values for `ttl` in ARP snapshots
- Added a new troubleshooting item to address how to handle when ARP snapshots fail due to a bug in the dependency
- Formatting and docstrings revisited

## Version 1.0.0

**Release Date:** *<20240131>*

<!-- trunk-ignore(markdownlint/MD024) -->
### What's New

- Shipping first release! 🚀
Expand Down
298 changes: 166 additions & 132 deletions docs/index.md

Large diffs are not rendered by default.

403 changes: 297 additions & 106 deletions docs/user-guide/docker/execution.md

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions docs/user-guide/docker/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ Encountering issues during the Docker execution of `pan-os-upgrade` can happen,

**Solution:** Ensure the filter syntax is correctly formatted and the specified criteria accurately reflect your firewall configuration in Panorama. Double-check network connectivity to Panorama and ensure the filters match the attributes of the firewalls you intend to upgrade.

### 9. ARP Table Comparison Failures

**Problem:** When capturing ARP tables for comparison, the script fails with `WrongDataTypeException: Unknown value format for key ttl`.

**Solution:** This issue can arise when ARP table entries contain integer values for `ttl`, which the current implementation may not handle properly. To address this, consider installing a custom fork of `panos-upgrade-assurance` that includes a fix for this issue, available at [https://github.com/cdot65/pan-os-upgrade-assurance/tree/main](https://github.com/cdot65/pan-os-upgrade-assurance/tree/main). Alternatively, you can configure the script to omit ARP snapshots from the tests if modifying the script is not feasible.

**Steps to Install Custom Fork:**

1. Run this command: `pip install git+https://github.com/cdot65/pan-os-upgrade-assurance.git@main`

**Steps to Omit ARP Snapshots:**

1. If using a `settings.yaml` file, ensure ARP snapshots are disabled.
2. If running the script interactively, choose not to capture ARP snapshots when prompted.

## General Tips

- Always verify your Docker setup and configurations before running `pan-os-upgrade`.
Expand Down
445 changes: 284 additions & 161 deletions docs/user-guide/python/execution.md

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions docs/user-guide/python/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,21 @@ After generating the locale, you can verify it's available by running `locale -a

If you cannot request `sudo` permissions within WSL2, either use the `pan-os-upgrade` script from the Windows CMD terminal, or use the Docker container.

### 10. ARP Table Comparison Failures

**Problem:** When capturing ARP tables for comparison, the script fails with `WrongDataTypeException: Unknown value format for key ttl`.

**Solution:** This issue can arise when ARP table entries contain integer values for `ttl`, which the current implementation may not handle properly. To address this, consider installing a custom fork of `panos-upgrade-assurance` that includes a fix for this issue, available at [https://github.com/cdot65/pan-os-upgrade-assurance/tree/main](https://github.com/cdot65/pan-os-upgrade-assurance/tree/main). Alternatively, you can configure the script to omit ARP snapshots from the tests if modifying the script is not feasible.

**Steps to Install Custom Fork:**

1. Run this command: `pip install git+https://github.com/cdot65/pan-os-upgrade-assurance.git@main`

**Steps to Omit ARP Snapshots:**

1. If using a `settings.yaml` file, ensure ARP snapshots are disabled.
2. If running the script interactively, choose not to capture ARP snapshots when prompted.

## General Tips

- Always perform a dry run (`--dry-run`) before executing the actual upgrade.
Expand Down
Binary file added pan_os_upgrade/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,879 changes: 1,149 additions & 730 deletions pan_os_upgrade/upgrade.py

Large diffs are not rendered by default.

594 changes: 313 additions & 281 deletions poetry.lock

Large diffs are not rendered by default.

29 changes: 27 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,47 @@
[tool.poetry]
name = "pan-os-upgrade"
version = "1.0.0"
version = "1.1.0"
description = "Python script to automate the upgrade process of PAN-OS firewalls."
authors = ["Calvin Remsburg <[email protected]>"]
documentation = "https://cdot65.github.io/pan-os-upgrade/"
license = "Apache 2.0"
readme = "README.md"
packages = [{ include = "pan_os_upgrade" }]
keywords = ["paloaltonetworks", "panos", "firewall", "upgrade", "automation"]
classifiers = [
"Development Status :: 4 - Beta",
"Framework :: Flake8",
"Framework :: Pydantic :: 2",
"Framework :: MkDocs",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Topic :: System :: Networking :: Firewalls",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Systems Administration",
"Topic :: Utilities",
]
include = ["pan_os_upgrade/assets/*.png"]
exclude = [
"pan_os_upgrade/assurance/*",
"pan_os_upgrade/logs/*",
"pan_os_upgrade/settings.yaml",
]


[tool.poetry.dependencies]
python = "^3.11"
pan-os-python = "^1.11.0"
panos-upgrade-assurance = "^0.3.1"
panos-upgrade-assurance = "^0.3.3"
pydantic = "^2.5.3"
typer = { extras = ["all"], version = "^0.9.0" }
setuptools = "^69.0.3"
dnspython = "^2.5.0"
dynaconf = "^3.2.4"
pyyaml = "^6.0.1"
reportlab = "^4.0.9"

[tool.poetry.group.dev.dependencies]
black = "^23.12.1"
Expand Down

0 comments on commit fbcb5f8

Please sign in to comment.