intentionet / netconan

netconan - a Network Configuration Anonymizer
Apache License 2.0
145 stars 12 forks source link

Fix sensitive/reserved word conflict #139

Closed sfraint closed 4 years ago

sfraint commented 4 years ago

Previously, specifying a sensitive word with capital letters would cause overlapping reserved words to be anonymized when they should instead be preserved.

Old behavior:

> cat input.txt 
ip address 10.10.10.10 0.0.0.0
# Sensitive word Addr here

> netconan -i input.txt -o output.txt -w ADDR

> cat output.txt
ip 2910daess 10.10.10.10 0.0.0.0
# Sensitive word 2910da here

After this PR (note the ip address line is now preserved):

> cat input.txt 
ip address 10.10.10.10 0.0.0.0

> netconan -i input.txt -o output.txt -w ADDR

> cat output.txt
ip address 10.10.10.10 0.0.0.0
# Sensitive word 169aaf here

This change is Reviewable