Skip to main content

pfBackup

Summary

Simple utility for backing up pfSense configuration which uses web admin interface.

Installation

Create backup user account

It is recommended to create a dedicated user account with limited permissions for backup purposes. This user should have "WebCfg - Diagnostics: Backup & Restore" permission. Please check pfSense documentation if you are not sure how to do this.

Installation form PyPI:

pip3 install pfbackup

Docker

You can download the image from Docker Hub:

docker pull mharjac/pfbackup

Or build it on your own:

docker build -t pfbackup https://github.com/mharjac/pfbackup.git#:docker

Create a volume for storing backups:

docker volume create pfbackup-firewall-1

Create a container:

docker run -d --name=pfbackup-firewall-1 -e PF_URL="https://192.168.1.1" -e PF_USER="backusr" -e PF_PASS="somesuperstrongpassword" -e PF_CERT_VERIFY="true" --mount=src=pfbackup-firewall-1,dst=/backup pfbackup:latest

And finally, for unattended regular backups, create a cron job which will execute:

docker start pfbackup-firewall-1

Install from Snap Store

snap install pfbackup

Usage

It can be used as an interactive tool from CLI:

pfbackup -U https://192.168.1.1 -u user1 -p passw0rd -f ./backup.xml

When used in CLI, it will prompt for password if -p (--password) flag is not provided. Also, without -f (--file) flag, config will be printed to the stdout.

It can also be used for unattended backups (e.g., in containers), in which case, it requires following environment variables:

  • PF_URL: for storing web admin URL (e.g., https://192.168.1.1/)
  • PF_USER: username for making backups
  • PF_PASS: password for provided username
  • PF_CERT_VERIFY: set to False if self-signed certificate in use
export PF_URL="https://192.168.1.1" PF_USER="user1" PF_PASS="passw0rd" PF_CERT_VERIFY="True"
pfbackup

When executed in unattended mode, configuration backup will be saved in execution directory as config-{time_stamp}.xml.

Release files for pfbackup 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pfbackup 1.1.1
File Size Uploaded
pfbackup-1.1.1.tar.gz 3.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pfbackup 1.1.1
File Interpreter ABI Platform
pfbackup-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.8 kB

Release files / pfbackup-1.1.1.tar.gz

Download URL pfbackup-1.1.1.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c8a55c2eb713c9d96715f3f6222665d871314cd11daecb9d96a4d7630d43272e
BLAKE2b-256 checksum
How to use checksums
3068a55aee1652714ec81fabdda96526ab8376a66c9d9f537005cd0463f46077
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.5rc1

Release files / pfbackup-1.1.1-py3-none-any.whl

Download URL pfbackup-1.1.1-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a6ca7375f4cec45c60319e28867ef24933802e4f93678764b07e3fa4f7eccf8
BLAKE2b-256 checksum
How to use checksums
403a7dc7ae04066707bb4610872bef3ea6dc7f001da17af75db682f592917de3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.5rc1

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page