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
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.0.tar.gz (265.5 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.0-py3-none-any.whl (52.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pfsense_redactor-1.2.0.tar.gz
  • Upload date:
  • Size: 265.5 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.0.tar.gz
Algorithm Hash digest
SHA256 5aaa0c7e547887d4715bdd93175316f13b40cc0e2b43329f3307beadcccfa5cd
MD5 f29a7550158bb029dd3b831806429fc5
BLAKE2b-256 c7dbd8ccded400bc0cade992c2ce386c3825079c9f712b6ec169bc0ed357fd62

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pfsense_redactor-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7e84fe7b9bb054653e98851e7b80ee2af9a326bdce8963addbd14381245c3a8
MD5 3868454c6f089d390b607ff3ebcc2fca
BLAKE2b-256 19505d9f6b55ef45865c1fbab163aa2bc84bd90cf93cd61c233b3353c9bc8270

See more details on using hashes here.

Provenance

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