This simple tool allows you to convert a full configuration backup of a opnSense firewall into some meaningful output format, like Markdown or YAML. It enables you to focus on the important parts of your firewall configuration and allows you to get a quick overview of the most important settings.
Before: Configuration backup as XML
After: Markdown documentation
OPNReport currently supports the following configuration sections:
Install into existing Python environment:
pip install git+https://github.com/AndyX90/OPNReport.git#egg=OPNReport
Combine this with --user
or pipx
or pipenv
for isolated installation.
Main formatting tool: opn-format
opn-format
Examples:
./opn-format -i config-backup.xml -f md -o test.md
./opn-format -i config-backup.xml -f yaml -o test.yaml
Test parsing tool: opn-parse
opn-parse [-h] input_path
Examples:
./opn-parse config-backup.xml
When using pfFocus via Docker, you don't need to download it from Github, and you don't need to install Python or any libraries. Only Docker is required.
It runs this command inside Docker: ./opn-format -q -f md -i - -o -
, which means it works with STDIN
and STDOUT
instead of files.
docker run --rm -i hghcr.io/tkcert/pffocus < input.xml > output.md
If you want you can set up an alias for it in bash:
alias pffocus="docker run --rm -i ghcr.io/tkcert/pffocus"
Then you can use it like a normal Unix command, with pipes and redirects:
pffocus < input.xml > output.md
Some ideas for the future development of OPNReport: