Skip to main content

Enterprise-grade tool to redact secrets and anonymise identifiers in pfSense/Netgate config.xml exports. Preserves network topology while removing passwords, VPN keys, certificates, public IPs, domains, and MACs for safe sharing with support teams, consultants, AI tools, and forums.

Project description

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.

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_redactor-1.2.2.tar.gz (319.1 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.2.2-py3-none-any.whl (70.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pfsense_redactor-1.2.2.tar.gz
Algorithm Hash digest
SHA256 21f0aa6a532b8eea61c718a0dc828b40d281e1690039789f2ea6ad0e5aabb0e3
MD5 d2df1a6a64c96e2fec1c76ff92829c5e
BLAKE2b-256 30b4a6c214ef5089f43511a4eaaa6d04c54b92a521fcf9c12e7b229b7ab84e45

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfsense_redactor-1.2.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.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pfsense_redactor-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5a65e1fec3c8725cb373c8a6645d90687ba3b8b0c8bd2bc52f1a3d4262fbdf30
MD5 214971b400e33e5aa5055625ef32d30c
BLAKE2b-256 47b0ce31067efd309a5a92948a84357f7e57c6edf5333252817f879c6f41dbdd

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfsense_redactor-1.2.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