From 6a95c75f01730607ab5e109286d06ee46182d574 Mon Sep 17 00:00:00 2001 From: Jan Jansky Date: Fri, 14 Jul 2023 07:32:39 +0200 Subject: [PATCH] sos updates to 9.3 Resolves: bz2217943 Signed-off-by: Jan Jansky --- sos-bz2207562-clean-obfuscate-mac.patch | 57 +++++++++++++++++++++++++ sos.spec | 9 +++- 2 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 sos-bz2207562-clean-obfuscate-mac.patch diff --git a/sos-bz2207562-clean-obfuscate-mac.patch b/sos-bz2207562-clean-obfuscate-mac.patch new file mode 100644 index 0000000..51a866d --- /dev/null +++ b/sos-bz2207562-clean-obfuscate-mac.patch @@ -0,0 +1,57 @@ +From 59c2660584734af92eca2eae31af3fbf5557f853 Mon Sep 17 00:00:00 2001 +From: Jan Jansky +Date: Mon, 10 Jul 2023 13:10:22 +0200 +Subject: [PATCH] [clean] Properly obfuscate MAC addresses + +Some of mac addresses was not properly obfuscated because +some collected data contains mac addresses in format +01: and parser was not ready for that. + +Also added mapper which will obfuscate mac address in case +it is in format with _ instead of : as for example + +00_50_56_87_5d_01 + +instead of + +00:50:56:87:5d:01 + +Format with _ is used for example by vmware plugin. + +Resolves: #3302 + +Signed-off-by: Jan Jansky +--- + sos/cleaner/mappings/mac_map.py | 2 +- + sos/cleaner/parsers/mac_parser.py | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/sos/cleaner/mappings/mac_map.py b/sos/cleaner/mappings/mac_map.py +index 334a6681..4ccba25a 100644 +--- a/sos/cleaner/mappings/mac_map.py ++++ b/sos/cleaner/mappings/mac_map.py +@@ -75,5 +75,5 @@ class SoSMacMap(SoSMap): + if re.match('(([0-9a-fA-F]{4}:){3}([0-9a-fA-F]){4})', item): + return self.mac6_quad_template % hextets + # match 48-bit IPv4 MAC addresses +- if re.match('([0-9a-fA-F]:?){12}', item): ++ if re.match('([0-9a-fA-F][:_]?){12}', item): + return self.mac_template % hextets +diff --git a/sos/cleaner/parsers/mac_parser.py b/sos/cleaner/parsers/mac_parser.py +index 88b0ac2e..4e790018 100644 +--- a/sos/cleaner/parsers/mac_parser.py ++++ b/sos/cleaner/parsers/mac_parser.py +@@ -25,8 +25,8 @@ IPV6_REG_4HEX = ( + ) + # aa:bb:cc:dd:ee:ff avoiding ipv6 substring matches + IPV4_REG = ( +- r'((? - 4.5.5-2 +- Adding patch for cleaning mac addresses + Resolves: bz2217943 + * Mon Jul 03 2023 Jan Jansky = 4.5.5-1 - Rebase on upstream 4.5.5 Resolves: bz2217943