pfSense config backup tool
Project description
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
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pfbackup-1.1.1.tar.gz
.
File metadata
- Download URL: pfbackup-1.1.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8a55c2eb713c9d96715f3f6222665d871314cd11daecb9d96a4d7630d43272e |
|
MD5 | 9cd9ccbd660702ff0076c33cb2b96191 |
|
BLAKE2b-256 | 3068a55aee1652714ec81fabdda96526ab8376a66c9d9f537005cd0463f46077 |
File details
Details for the file pfbackup-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: pfbackup-1.1.1-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a6ca7375f4cec45c60319e28867ef24933802e4f93678764b07e3fa4f7eccf8 |
|
MD5 | 270f60c427dc242fe127e3c0fa9ebd98 |
|
BLAKE2b-256 | 403a7dc7ae04066707bb4610872bef3ea6dc7f001da17af75db682f592917de3 |