Skip to main content

pfSense Git Config

Import pfSense config changes into a git repo.

This gives you a record of individual config updates, and allows you to browse the changes easily.

NOTE: Your pfSense config data is sensitive - it will contain hashed passwords and information about the networks served by your firewall. I would only keep this on a private git server and with access restrictions on the repo as well.

Current Version

Version: 1.0.0

Usage

Usage: pfsense_git_config [OPTIONS]

Read pfSense configation changes, add them to a Git repo of config changes

Reads the current pfsense configuration file (in /conf/config.xml by default), and the configuration backups (in /conf/backup/config-<timestamp>.xml by default) to contruct a set of timestamp config snapshots. All of these that are more recent than the last timestamp in the git repo are written into the git repo, with their timestamps, in cronological order as one commit per config change. The revision description is used as the commit message.

If --pull is specified (set by default), the git repo is pulled at the start of the process. If --push is specificed (set by default), the git repo is pushed to origin at the end of the process even if no updates are made.

Remember that your pfsense configs should not be publically visible as they contain sensitive information about your network including hashed passwords stored within pfSense.

Options

  • --version - Report version
  • --config - Configuration file [env var: PGC_CONFIG] Default .pfsense_git_config
  • --verbose / --no-verbose - Output verbose information.
  • --pull / --no-pull - Pull the git repo before updating (set by default)
  • --push / --no-push - Push the git repo at the end (set by default)
  • --config-dir - Directory with pfSense configurations [env var: PGC_PFSENSE_CONFIG_DIR] Default /conf
  • --git-dir - Location of the git repo the pfSense config updates are to be stored in [env var: PGC_GIT_DIR] Default ~/pfsense_config

Installation and Setup

  • Create a user account (with ssh access)
  • Ensure that the Cron additional package is installed (required to run the checks regularly)
  • Ensure that python and git are installed (this needs a root login session to use pkg install)
  • Logged in to your user account:-
    • create a python venv - python3.11 -m venv venv
    • activate it - source venv/bin/activate.csh
    • install the package - pip install --update pfsense_git_config
    • create/clone a git repo in ~/pfsense_config to put the configs into. The git repo should have a remote elsewhere - I use a local gitea instance. There should be a local ssh key or other authentication mechanism that allows push/pull to the remote.
    • run pfsense_git_config
    • add an invocation script - such as run_pfsense_git_config.sh form this repo
    • set up cron to run this regularly - say once or twice a day

Metadata

Release files for pfsense-git-config 1.0.0

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

Source distribution (sdist)

Source distribution for pfsense-git-config 1.0.0
File Size Uploaded Provenance Actions
pfsense_git_config-1.0.0.tar.gz 5.1 kB Without provenance Details for pfsense_git_config-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pfsense-git-config 1.0.0
File Interpreter ABI Platform Actions
pfsense_git_config-1.0.0-py3-none-any.whl Python 3 none any Details for pfsense_git_config-1.0.0-py3-none-any.whl

Total release size: 11.8 kB

Release files / pfsense_git_config-1.0.0.tar.gz

Download URL pfsense_git_config-1.0.0.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cd26653e4fbc7ca3a0cc80437eb54c80d86f1e6951f15543ea0d59a70180ae13
BLAKE2b-256 checksum
How to use checksums
69ca917ca0f95ad211f762183d91074cc077e8ed628556014a73a006e361e432
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1040-azure

Release files / pfsense_git_config-1.0.0-py3-none-any.whl

Download URL pfsense_git_config-1.0.0-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb04047e8a2e369922022542467977df48c4ec6c5fe169b60c2c897678b98e02
BLAKE2b-256 checksum
How to use checksums
d810225d2f80feef704b05a35d2a1f05e52f300f2d72b7eca13d1eee5ce2412b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1040-azure

Security for pfsense-git-config 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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