Skip to main content

pfSense XML Configuration Redactor

PyPI version Python Versions License: MIT Tests Downloads

Redact secrets from a pfSense config.xml so you can share it with Netgate support, a vendor, a forum or an AI tool, without handing over your passwords, keys and network layout.

Unlike generic XML redaction, it understands pfSense structures: IPsec, OpenVPN, WireGuard, captive portal, and the package configs where credentials actually hide.

Install

pip install pfsense-redactor

Pure Python standard library, no dependencies, Python 3.9+.

If pip reports externally-managed-environment

Common on macOS and recent Linux distributions. Any of these work:

pipx install pfsense-redactor          # recommended for CLI tools
python3 -m venv venv && source venv/bin/activate
pip install pfsense-redactor
pip install --user pfsense-redactor
From source
git clone https://github.com/grounzero/pfsense-redactor.git
cd pfsense-redactor
pip install -e .

Quick start

Sharing with support, keeping internal addressing readable:

pfsense-redactor config.xml redacted.xml --keep-private-ips

Removes secrets and public identifiers, leaves RFC 1918 addressing intact so whoever is helping can still follow your topology.

Sharing with a vendor, forum or AI tool, anonymising identifiers:

pfsense-redactor config.xml redacted.xml --anonymise

Replaces addresses and domains with consistent placeholders, so relationships between rules and interfaces survive while the real values do not.

Check before you commit to it:

pfsense-redactor config.xml --dry-run-verbose

Prints what would change, with samples safely masked.

Using an unusual package? Add --aggressive. Webhook tokens live in URL paths, and paths are otherwise preserved so package feed URLs are not destroyed. Slack, Discord and Telegram are recognised and redacted without it; anything else needs the flag. See security.

How well does it work?

Measured against a 46-secret canary corpus that ships with the repository:

Tool Caught
pfsense-redactor 44 / 46 (45 with --redact-descriptions)
ForesightCyber Config Anonymizer 17 / 46
netgate-xlsx 11 / 46

The corpus was built alongside this tool, which biases it. Every released version was re-run against it to measure by how much: 31 of the 46 markers were planted against gaps this tool had, and none came from outside the project. Both misses are documented rather than hidden. Run it yourself:

pfsense-redactor tests/corpus/canary-corpus.xml --stdout --aggressive \
  | grep -oE 'CANARY_[A-Z0-9_]+' | sort -u

Full method, caveats and per-secret results in the benchmark.

Before you share the output

Never restore a redacted file to pfSense. Comments, CDATA and some metadata do not survive the round trip. Keep your original.

Read the run summary. It reports high-entropy values it deliberately kept, with their element paths, so you can audit them. For a second opinion from a scanner that fails differently, see verifying output.

Documentation

Guide Covers
CLI reference Every flag, with examples
Use cases Netgate TAC, AI tools, MSP handoff, audits, and how this relates to diag_sanitize.php
Allow-lists Keep specific IPs, CIDRs and domains readable
Security Threat model, what gets redacted, path safety
Verifying output Checking the result, and using gitleaks alongside
Benchmark Canary corpus results and known gaps
Examples Before/after output, statistics, testing
FAQ Common questions
Security remediation tracker Status of the July 2026 review findings
Changelog Release history

Contributing

Issues and pull requests are welcome. If you find a secret that survives redaction, that is the most valuable report there is. A minimal fragment with the value replaced by a CANARY_* marker can go straight into the corpus so the miss stays fixed.

Run the tests with:

pip install -e ".[dev]"
pytest

Licence

MIT. See LICENSE.

Download files

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

Source Distribution

pfsense_redactor-1.4.2.tar.gz (349.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pfsense_redactor-1.4.2-py3-none-any.whl (83.7 kB view details)

Uploaded Python 3

File details

Details for the file pfsense_redactor-1.4.2.tar.gz.

File metadata

  • Download URL: pfsense_redactor-1.4.2.tar.gz
  • Upload date:
  • Size: 349.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for pfsense_redactor-1.4.2.tar.gz
Algorithm Hash digest
SHA256 3e8c92fcf502c0c3d1a5970f20a1c7cd4d6dd07355adcdd78033eeca6bb938ca
MD5 75e3ff7a10dd0b5d929d608bd4922073
BLAKE2b-256 a6ec46809ca5d17e616aad19c0d37717c7f9b8331506e52cbb1b47c3d5b21ed2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfsense_redactor-1.4.2.tar.gz:

Publisher: python-publish.yml on grounzero/pfsense-redactor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pfsense_redactor-1.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pfsense_redactor-1.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 06cd7c929539bd46e508eb2c920284ff3e3e0ed1b26a6753497814ab46712fce
MD5 bc214ae66e357f0e338f1676888e7d0e
BLAKE2b-256 c41bb3ad7bc583618a03bed0a47ded9b704b5bbafbfebc9ea1d8f5269d52fa97

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfsense_redactor-1.4.2-py3-none-any.whl:

Publisher: python-publish.yml on grounzero/pfsense-redactor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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