summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-11-06 20:25:24 +0100
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2023-11-07 16:40:02 +0000
commita8645039c4f1a6a5455e4d91c95cde06b8a1b9b1 (patch)
treee0d51cc30e6092be1e423474c7dcb13a5b1f1c6f /src
parent3e48e0cb95650b5fbd94e39fa78b002ebe468be3 (diff)
downloadvyos-1x-a8645039c4f1a6a5455e4d91c95cde06b8a1b9b1.tar.gz
vyos-1x-a8645039c4f1a6a5455e4d91c95cde06b8a1b9b1.zip
T5713: only strip "secret" CLI node and nothing else
Commit 30eb308149 ("T5713: Strip string after "secret" in IPSEC config") had good intention but this will happen: use-secret foo CLI node will become " secret xxxxxx" so the output of strip-private invalidates the configuration. This has been changed to an exact match of "secret" only (cherry picked from commit 863af115df853987dd8ad25ecef3f0ea58485e83)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/helpers/strip-private.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/helpers/strip-private.py b/src/helpers/strip-private.py
index 9b2019817..cb29069cf 100755
--- a/src/helpers/strip-private.py
+++ b/src/helpers/strip-private.py
@@ -1,6 +1,6 @@
#!/usr/bin/python3
-# Copyright 2021-2022 VyOS maintainers and contributors <maintainers@vyos.io>
+# Copyright 2021-2023 VyOS maintainers and contributors <maintainers@vyos.io>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -21,7 +21,6 @@ import sys
from netaddr import IPNetwork, AddrFormatError
-
parser = argparse.ArgumentParser(description='strip off private information from VyOS config')
strictness = parser.add_mutually_exclusive_group()
@@ -119,7 +118,7 @@ if __name__ == "__main__":
(True, re.compile(r'(shared-secret-key-file|ca-cert-file|cert-file|dh-file|key-file|client) (\S+)'), r'\1 xxxxxx'),
# Strip IPSEC secrets
(True, re.compile(r'pre-shared-secret \S+'), 'pre-shared-secret xxxxxx'),
- (True, re.compile(r'\ssecret \S+'), ' secret xxxxxx'),
+ (True, re.compile(r'secret \S+'), 'secret xxxxxx'),
# Strip OSPF md5-key
(True, re.compile(r'md5-key \S+'), 'md5-key xxxxxx'),
# Strip WireGuard private-key