summaryrefslogtreecommitdiff
path: root/src/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers')
-rwxr-xr-xsrc/helpers/strip-private.py17
-rwxr-xr-xsrc/helpers/vyos-bridge-sync.py51
2 files changed, 9 insertions, 59 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)
-
diff --git a/src/helpers/vyos-bridge-sync.py b/src/helpers/vyos-bridge-sync.py
deleted file mode 100755
index 097d28d85..000000000
--- a/src/helpers/vyos-bridge-sync.py
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env python3
-#
-# Copyright (C) 2019 VyOS maintainers and contributors
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 or later as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-
-# Script is used to synchronize configured bridge interfaces.
-# one can add a non existing interface to a bridge group (e.g. VLAN)
-# but the vlan interface itself does yet not exist. It should be added
-# to the bridge automatically once it's available
-
-import argparse
-from sys import exit
-from time import sleep
-
-from vyos.config import Config
-from vyos.util import cmd, run
-
-
-if __name__ == '__main__':
- parser = argparse.ArgumentParser()
- parser.add_argument('-i', '--interface', action='store', help='Interface name which should be added to bridge it is configured for', required=True)
- args, unknownargs = parser.parse_known_args()
-
- conf = Config()
- if not conf.list_nodes('interfaces bridge'):
- # no bridge interfaces exist .. bail out early
- exit(0)
- else:
- for bridge in conf.list_nodes('interfaces bridge'):
- for member_if in conf.list_nodes('interfaces bridge {} member interface'.format(bridge)):
- if args.interface == member_if:
- command = 'brctl addif "{}" "{}"'.format(bridge, args.interface)
- # let interfaces etc. settle - especially required for OpenVPN bridged interfaces
- sleep(4)
- # XXX: This is ignoring any issue, should be cmd but kept as it
- # XXX: during the migration to not cause any regression
- run(command)
-
- exit(0)