Skip to main content

Netconan

Netconan (network configuration anonymizer) anonymizes text files that contain sensitive network information.

With Netconan, a sensitive input file

$ cat sensitive/cisco.cfg
! This is intentionet's sensitive comment
username admin password 7 122A001901
enable secret 5 $1$wtHI$0rN7R8PKwC30AsCGA77vy.
!
tacacs-server host 1.2.3.4 key pwd1234
ip address 10.10.20.30/24
ip address 2001:2002::9d3b:1
!
route-map sea-to-lax ...
route-map sea-to-atl ...

can be anonymized

$ netconan -i sensitive -o anonymized \
    --sensitive-words intentionet,sea,lax,atl \
    --anonymize-passwords \
    --anonymize-ips
WARNING No salt was provided; using randomly generated "WNo5pX28MJOrqxfv"
INFO Anonymizing cisco.cfg

to produce an output file you can feel comfortable sharing.

$ cat anonymized/cisco.cfg
! This is db1792's sensitive comment
username admin password 7 09424B1D1A0A1913053E012724322D3765
enable secret 5 $1$0000$EhfXcDfB7iiakW6mwMy1i.
!
tacacs-server host 7.227.130.88 key netconanRemoved2
ip address 10.72.218.183/24
ip address cd7e:83e:1eaf:2ada:7535:591e:6d47:a4b8
!
route-map e69ceb-to-880ac2 ...
route-map e69ceb-to-5d37ad ...

Installing Netconan

Install Netconan using pip:

$ pip install netconan

Features

Netconan can anonymize many types of sensitive information:

  • Sensitive strings like passwords or SNMP community strings (--anonymize-passwords, -p), for many common network vendors.

  • IPv4 and IPv6 addresses (--anonymize-ips, -a).

  • User-specified sensitive words (--sensitive-words, -w). Note that any occurrence of a specified sensitive word will be replaced regardless of context, even if it is part of a larger string.

  • User-specified AS numbers (--as-numbers, -n). Note that any number matching a specified AS number will be anonymized.

Netconan attempts to preserve useful structure. For example,

  • Netconan preserves prefixes when anonymizing IPv4 and IPv6 addresses: IP addresses with a common prefix before anonymization will share the same prefix length after anonymization. For more information, see J. Xu et al., On the Design and Performance of Prefix-Preserving IP Traffic Trace Anonymization, ACM SIGCOMM Workshop on Internet Measurement, 2001 [link].

  • IPv4 classes and private-use prefixes (see IANA IPv4 assignments) are preserved by default, but can be overridden (with --preserve-prefixes e.g. --preserve-prefixes 12.0.0.0/8 will preserve a leading octet 12 of IP addresses encountered but anonymize octets after the 12).

  • By default, the last 8 bits of each IP address are preserved. This prevents IP anonymization from breaking important network structure such as point-to-point IPv4 /30 links or NAT pools. This can be overridden to a new number B using --preserve-host-bits B, and it can be disabled entirely using --preserve-host-bits 0.

  • Specific addresses can optionally be preserved, e.g.

    • --preserve-addresses skips anonymizing the specified network or address. For example, --preserve-addresses 12.0.0.0/8,13.12.11.10 will skip anonymization for any address in the 12.0.0.0/8 network and skip anonymizing 13.12.11.10.

    • --preserve-private-addresses skips anonymizing all addresses that fall under private-use blocks.

  • AS number blocks are preserved (i.e. an anonymized public AS number will still be in the public AS number range after anonymization).

  • Standard password and hash formats (salted md5, Cisco Type 7, Juniper Type 9) are recognized and substituted with format-compliant replacements.

Netconan is deterministic when provided the same user-controllable salt (--salt, -s). Files processed using the same salt are compatible (e.g., IP addresses anonymized the same way) whether anonymized together or separately. Setting the salt in a configuration file is recommended, so that you can get compatible anonymization each time you use netconan.

For reversible operations (specifically, IP address anonymization), Netconan can produce a de-anonymized file (--undo, -u) when provided with the same salt used in anonymization (--salt, -s).

Running netconan

Netconan processes the input file or recursively processes files in the input directory (skipping files starting with .) and saves processed files at the specified output.

For more information about less commonly-used features, see the Netconan help (-h). For more information on config file syntax, see here.

usage: netconan [-h] [--version] [-a] [-c CONFIG] [-d DUMP_IP_MAP] -i INPUT
                [-l {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [-n AS_NUMBERS] -o
                OUTPUT [-p] [-r RESERVED_WORDS] [-s SALT] [-u]
                [-w SENSITIVE_WORDS] [--preserve-prefixes PRESERVE_PREFIXES]
                [--preserve-addresses PRESERVE_ADDRESSES]
                [--preserve-private-addresses]
                [--preserve-host-bits PRESERVE_HOST_BITS]

Args that can start with '--' can also be set in a config file (specified via
-c). If an arg is specified in more than one place, then command line values
override config file values which override defaults. Config file syntax
allows: key=value, flag=true, stuff=[a,b,c] (for more details, see here
https://goo.gl/R74nmi).

optional arguments:
  -h, --help            show this help message and exit
  --version             Print version number and exit
  -a, --anonymize-ips   Anonymize IP addresses
  -c CONFIG, --config CONFIG
                        Netconan configuration file with defaults for these
                        CLI parameters
  -d DUMP_IP_MAP, --dump-ip-map DUMP_IP_MAP
                        Dump IP address anonymization map to specified file
  -i INPUT, --input INPUT
                        Input file or directory containing files to anonymize
  -l {DEBUG,INFO,WARNING,ERROR,CRITICAL}, --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Determines what level of logs to display
  -n AS_NUMBERS, --as-numbers AS_NUMBERS
                        List of comma separated AS numbers to anonymize
  -o OUTPUT, --output OUTPUT
                        Output file or directory where anonymized files are
                        placed
  -p, --anonymize-passwords
                        Anonymize password and snmp community lines
  -r RESERVED_WORDS, --reserved-words RESERVED_WORDS
                        List of comma separated words that should not be
                        anonymized
  -s SALT, --salt SALT  Salt for IP and sensitive keyword anonymization
  -u, --undo            Undo reversible anonymization (must specify salt)
  -w SENSITIVE_WORDS, --sensitive-words SENSITIVE_WORDS
                        List of comma separated keywords to anonymize
  --preserve-prefixes PRESERVE_PREFIXES
                        List of comma separated IP prefixes to preserve.
                        Specified prefixes are preserved, but the host bits
                        within those prefixes are still anonymized. To
                        preserve prefixes and host bits in specified blocks,
                        use --preserve-addresses instead
  --preserve-addresses PRESERVE_ADDRESSES
                        List of comma separated IP addresses or networks to
                        preserve. Prefixes and host bits within those networks
                        are preserved. To preserve just prefixes and anonymize
                        host bits, use --preserve-prefixes
  --preserve-private-addresses
                        Preserve private-use IP addresses. Prefixes and host
                        bits within the private-use IP networks are preserved.
                        To preserve specific addresses or networks, use
                        --preserve-addresses instead. To preserve just
                        prefixes and anonymize host bits, use --preserve-
                        prefixes
  --preserve-host-bits PRESERVE_HOST_BITS
                        Preserve the trailing bits of IP addresses, aka the
                        host bits of a network. Set this value large enough to
                        represent the largest interface network (e.g., 8 for a
                        /24 or 12 for a /20) or NAT pool.

Metadata

Release files for netconan 0.15.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for netconan 0.15.0
File Size Uploaded Provenance
netconan-0.15.0.tar.gz 62.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for netconan 0.15.0
File Interpreter ABI Platform
netconan-0.15.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 123.2 kB

Release files / netconan-0.15.0.tar.gz

Download URL netconan-0.15.0.tar.gz
Size 62.2 kB
Tags Source
SHA-256 checksum
How to use checksums
15a8a48552ad99152d74a22ee97f60fe7d9915ee42f7f6336826d9ff2a3271d0
BLAKE2b-256 checksum
How to use checksums
dc99d2998aa8ed49ff184b8fede15131572095dade3c50e6ffcc1dc4f65e4220
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 5, 2026.

Transparency log

Release files / netconan-0.15.0-py2.py3-none-any.whl

Download URL netconan-0.15.0-py2.py3-none-any.whl
Size 61.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
4b3992f5e358a19be88af79a8136c1961eb97dfb0c2b6b4df3ddb3f8658d2861
BLAKE2b-256 checksum
How to use checksums
fd1718107be4d178b30e52f2a33cd3800a823c92f8692134b929951ab7893256
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 5, 2026.

Transparency log

Security for netconan 0.15.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for netconan-0.15.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page