Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    Tool: pfSense configuration redactor

    Scheduled Pinned Locked Moved General pfSense Questions
    pfsensefirewallredactionpython3
    4 Posts 1 Posters 1.8k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      grounzero
      last edited by

      I’ve put together a small open-source tool to help safely share config.xml files when seeking support. It automatically removes sensitive information (passwords, keys, public IPs, etc.) whilst keeping the structure intact for troubleshooting.

      Project link:
      https://github.com/grounzero/pfsense-redactor

      Early days yet — feedback and test examples would be very welcome.

      Thanks.

      G 1 Reply Last reply
      Reply Quote 5
      • P pwood999 referenced this topic on
      • G
        grounzero @grounzero
        last edited by

        Just pushed some updates, added a --check-version tfor easy upgrades and some extra validations and fixed a bug where redacting URLs/emails was corrupting whitespace and mangling the output.

        Added --quiet and --verbose flags too if you want less/more output.

        Open to feature requests, bug reports, or contributions if anyone's got ideas!

        G 1 Reply Last reply
        Reply Quote 1
        • G
          grounzero @grounzero
          last edited by

          https://pypi.org/project/pfsense-redactor/

          1 Reply Last reply
          Reply Quote 0
          • LaxarusL Laxarus referenced this topic on
          • G
            grounzero
            last edited by

            pfsense-redactor 1.1.2 released - much wider secret coverage since 1.0.x

            Open-source tool for stripping secrets out of config.xml before you share it
            with support, a consultant, a forum or an AI tool. Python, standard library
            only, no dependencies.

            Quite a lot has changed since the last update in this thread. The main one is
            coverage: secret detection now matches the element names pfSense and its
            packages actually write, rather than the ones you would guess.

            • SNMP: rocommunity, rwcommunity
            • Wireless: passphrase (WPA/WPA2 PSK)
            • VPN: auth_pass, presharedkey (WireGuard), ipsecpsk, eap_password
            • Auth: radiussecret, authorizedkeys
            • Packages: accountkey (ACME), dns_cf_token and maxmind_key (pfBlockerNG),
              influx_token (Telegraf), tlspskvalue (Zabbix), access_key and
              secret_access_key (S3), userkey (Pushover), ha_certificates and
              ssloffloadcert (HAProxy)

            Suffixed spellings are handled too, so password2 and passwordagain go the
            same way as password.

            Beyond element names:

            • URLs are taken apart properly. Credentials in query strings and in
              user:pass@host are redacted, not just the hostname
            • Slack, Discord, Telegram and Teams webhook tokens go in default mode. The
              URL is the entire credential, so anyone holding it can post as that
              integration
            • Free-text blocks such as custom_options are scanned for inline credentials,
              which is where OpenVPN auth-user-pass and askpass usually live
            • PEM and base64 key material is detected by content, in any element
            • --redact-descriptions covers free-text elements and attributes, for the
              DHCP static-map descriptions that quietly collect people's names

            It also tries hard not to over-redact. Network topology survives, so the
            config is still readable for troubleshooting, and pfBlockerNG feed URLs like
            emerging-block.rules are left intact rather than mangled into example.com.
            Whatever it decides to keep, it tells you about, with the element path.

            For automation, --fail-on-warn turns it into a CI gate: non-zero exit if
            anything high-entropy was retained, --dry-run included, so you can check a
            config without writing one.

            There is a benchmark in the repo. 46 planted secrets in a published corpus,
            42 caught with --aggressive and 43 adding --redact-descriptions, with the
            misses listed and explained rather than hidden. The corpus and the scoring
            both ship, so you can re-run it yourself instead of taking the number on
            trust. Default mode catches fewer and the docs say how many.

            If you are on 1.0.x, the coverage difference is large and worth the upgrade.

            https://pypi.org/project/pfsense-redactor/

            https://github.com/grounzero/pfsense-redactor

            pip install pfsense-redactor
            

            Python 3.9+. Redacted output is for sharing only. Never import it back into
            pfSense.

            1 Reply Last reply
            Reply Quote 1

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post
            Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
            Privacy Policy · Cookie Policy