Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions ncdiff/src/yang/ncdiff/runningconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,50 @@ def _normalize_passwords(config_text):
# Normalize SNMPv3 priv passwords (aes, 3des)
config_text = re.sub(r'(snmp-server user \S+ \S+ v3 auth .* priv .* 6 )\S+',r'\1<ENCRYPTED>',config_text)

# pre-shared key
config_text = re.sub(r'(pre-shared-key 6 )\S+', r'\1<ENCRYPTED>', config_text)

#RADIUS "key 6"
config_text = re.sub(r'(^\s*key 6 )\S+', r'\1<ENCRYPTED>', config_text)

# RADIUS dynamic-author client server-key 6
config_text = re.sub(r'(^\s*client \S+ \S+ server-key 6 )\S+', r'\1<ENCRYPTED>', config_text)

#server-private 1.1.1.1 port 9000 timeout 11 key 6 "VK`_MgLehfgK`OS\UHRHORaOGcQcGZAAB"
config_text = re.sub(r'(server-private .* key 6 )"[^"]*"', r'\1"<ENCRYPTED>"', config_text)

#key 6 GZdRiQBTaJZUUPaPYTQOSdXSAAB
config_text = re.sub(r'(\bkey 6 )"[^"]*"', r'\1"<ENCRYPTED>"', config_text)
config_text = re.sub(r'(\bkey 6 )\S+', r'\1<ENCRYPTED>', config_text)

#pac key 6 RgDJOJDD[Tbg`CJIbdTO[DcaBANg`JMHV
config_text = re.sub(r'(pac key 6 )\S+', r'\1<ENCRYPTED>', config_text)

#tacacs-server key 6 "aSeRcVQYHMNgX`^LSU_PS\XfVYNeaUDSGXSX",
config_text = re.sub(r'(tacacs-server key 6 )"[^"]*"', r'\1"<ENCRYPTED>"', config_text)
config_text = re.sub(r'(tacacs-server key 6 )\S+', r'\1<ENCRYPTED>', config_text)

#username USR1 common-criteria-policy uvwxy password 6 KIC\D^aV`XAGPL]]
config_text = re.sub(r'(username \S+ .* password 6 )\S+', r'\1<ENCRYPTED>', config_text)

#bind authenticate root-dn AUTH1 password 6 YQCHWfLbHNRG\eBbKFdFaLLC
config_text = re.sub(r'(bind authenticate .* password 6 )\S+', r'\1<ENCRYPTED>', config_text)

#isakmp authorization list NEW password 6 TLhePfG\iA^[BaI^bMIhPS^\baA]K^`Qae]a
config_text = re.sub(r'(isakmp authorization list .* password 6 )\S+', r'\1<ENCRYPTED>', config_text)

#cts sxp default password 6 aHAYIbIQ`JQEGi\IHg__GZIR`KJcXHHFQgJJ
#cts credentials id userstring password 6 ^NhHC[ZNKQGdAHMbP_RgLYKRAAB,
config_text = re.sub(r'(cts .* password 6 )\S+', r'\1<ENCRYPTED>', config_text)

#snmp mib community-map 6 Z`SODbTYi]cG_MDRSEZGP\[OWfeaAMHf] engineid 12345ABCD6
config_text = re.sub(r'(snmp mib community-map 6 )\S+', r'\1<ENCRYPTED>', config_text)

#key 6 GZdRiQBTaJZUUPaPYTQOSdXSAAB
config_text = re.sub(r'(\s6 )"[^"]*"', r'\1"<ENCRYPTED>"', config_text)
config_text = re.sub(r'(\s6 )[^,\s]+', r'\1<ENCRYPTED>', config_text)
config_text = re.sub(r'(,6)\s*[^,\s]+', r'\1 <ENCRYPTED>', config_text)

return config_text

def running2list(self, str_in_1, str_in_2):
Expand Down