Skip to main content

pfSense Git Config

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pfsense_git_config-1.0.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

pfsense_git_config-1.0.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file pfsense_git_config-1.0.0.tar.gz.

File metadata

  • Download URL: pfsense_git_config-1.0.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1040-azure

File hashes

Hashes for pfsense_git_config-1.0.0.tar.gz
Algorithm Hash digest
SHA256 cd26653e4fbc7ca3a0cc80437eb54c80d86f1e6951f15543ea0d59a70180ae13
MD5 90b765ecf2b7d3851c27a4fb16101e3e
BLAKE2b-256 69ca917ca0f95ad211f762183d91074cc077e8ed628556014a73a006e361e432

See more details on using hashes here.

File details

Details for the file pfsense_git_config-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pfsense_git_config-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1040-azure

File hashes

Hashes for pfsense_git_config-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb04047e8a2e369922022542467977df48c4ec6c5fe169b60c2c897678b98e02
MD5 fa636384416d0d69adc9c1d8528777d6
BLAKE2b-256 d810225d2f80feef704b05a35d2a1f05e52f300f2d72b7eca13d1eee5ce2412b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page