summaryrefslogtreecommitdiff
path: root/src/helpers
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-08-10 09:16:14 +0200
committerChristian Poessinger <christian@poessinger.com>2021-08-10 09:16:16 +0200
commit0b37de6ba97810636ecbf9a84c6df8f5409ae78c (patch)
tree35f88854bdd272e0af0dd0d6f2201a867a294cf2 /src/helpers
parent96049e6fdad05bd73423ea64780e90b385807cb9 (diff)
downloadvyos-1x-0b37de6ba97810636ecbf9a84c6df8f5409ae78c.tar.gz
vyos-1x-0b37de6ba97810636ecbf9a84c6df8f5409ae78c.zip
pki: wireguard: T3642: strip private key
Extend regex used by the "| strip-private" modifier to remove the WireGuard private key portion from stdout.
Diffstat (limited to 'src/helpers')
-rwxr-xr-xsrc/helpers/strip-private.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/helpers/strip-private.py b/src/helpers/strip-private.py
index 420a039eb..c165d2cba 100755
--- a/src/helpers/strip-private.py
+++ b/src/helpers/strip-private.py
@@ -116,32 +116,33 @@ if __name__ == "__main__":
(True, re.compile(r'pre-shared-secret \S+'), 'pre-shared-secret xxxxxx'),
# Strip OSPF md5-key
(True, re.compile(r'md5-key \S+'), 'md5-key xxxxxx'),
-
+ # Strip WireGuard private-key
+ (True, re.compile(r'private-key \S+'), 'private-key xxxxxx'),
+
# Strip MAC addresses
(args.mac, re.compile(r'([0-9a-fA-F]{2}\:){5}([0-9a-fA-F]{2}((\:{0,1})){3})'), r'XX:XX:XX:XX:XX:\2'),
# Strip host-name, domain-name, and domain-search
(args.hostname, re.compile(r'(host-name|domain-name|domain-search) \S+'), r'\1 xxxxxx'),
-
+
# Strip user-names
(args.username, re.compile(r'(user|username|user-id) \S+'), r'\1 xxxxxx'),
# Strip full-name
(args.username, re.compile(r'(full-name) [ -_A-Z a-z]+'), r'\1 xxxxxx'),
-
+
# Strip DHCP static-mapping and shared network names
(args.dhcp, re.compile(r'(shared-network-name|static-mapping) \S+'), r'\1 xxxxxx'),
-
+
# Strip host/domain names
(args.domain, re.compile(r' (peer|remote-host|local-host|server) ([\w-]+\.)+[\w-]+'), r' \1 xxxxx.tld'),
-
+
# Strip BGP ASNs
(args.asn, re.compile(r'(bgp|remote-as) (\d+)'), r'\1 XXXXXX'),
-
+
# Strip LLDP location parameters
(args.lldp, re.compile(r'(altitude|datum|latitude|longitude|ca-value|country-code) (\S+)'), r'\1 xxxxxx'),
-
+
# Strip SNMP location
(args.snmp, re.compile(r'(location) \S+'), r'\1 xxxxxx'),
]
strip_lines(stripping_rules)
-