1
0
forked from rpms/sos

sos updates to 8.9

Resolves: bz2218279 bz2216608 bz2207562

Signed-off-by: Jan Jansky <jjansky@redhat.com>
This commit is contained in:
Jan Jansky 2023-07-14 07:52:31 +02:00
parent 4b746d78d4
commit 82638f57e9
2 changed files with 66 additions and 1 deletions

View File

@ -0,0 +1,57 @@
From 59c2660584734af92eca2eae31af3fbf5557f853 Mon Sep 17 00:00:00 2001
From: Jan Jansky <jjansky@redhat.com>
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:<mac> 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 <jjansky@redhat.com>
---
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'((?<!([0-9a-fA-F\'\"]:)|::)(([^:\-])?([0-9a-fA-F]{2}([:-])){5}'
- r'([0-9a-fA-F]){2}(\'|\")?(\/|\,|\-|\.|\s|$)))'
+ r'((?<!([0-9a-fA-F\'\"]:)|::)'
+ r'(([^:\-])?(([0-9a-fA-F]{2}([:\-\_])){5,6}([0-9a-fA-F]{2}))))'
)
--
2.31.1

View File

@ -5,7 +5,7 @@
Summary: A set of tools to gather troubleshooting information from a system Summary: A set of tools to gather troubleshooting information from a system
Name: sos Name: sos
Version: 4.5.5 Version: 4.5.5
Release: 1%{?dist} Release: 2%{?dist}
Group: Applications/System Group: Applications/System
Source0: https://github.com/sosreport/sos/archive/%{version}/sos-%{version}.tar.gz Source0: https://github.com/sosreport/sos/archive/%{version}/sos-%{version}.tar.gz
Source1: sos-audit-%{auditversion}.tgz Source1: sos-audit-%{auditversion}.tgz
@ -23,6 +23,7 @@ Recommends: python3-pyyaml
Conflicts: vdsm < 4.40 Conflicts: vdsm < 4.40
Obsoletes: sos-collector Obsoletes: sos-collector
Patch1: sos-bz2218279-clean-respect-permissions.patch Patch1: sos-bz2218279-clean-respect-permissions.patch
Patch2: sos-bz2207562-clean-obfuscate-mac.patch
%description %description
Sos is a set of tools that gathers information about system Sos is a set of tools that gathers information about system
@ -34,6 +35,7 @@ support technicians and developers.
%setup -qn %{name}-%{version} %setup -qn %{name}-%{version}
%setup -T -D -a1 -q %setup -T -D -a1 -q
%patch1 -p1 %patch1 -p1
%patch2 -p1
%build %build
%py3_build %py3_build
@ -106,6 +108,12 @@ of the system. Currently storage and filesystem commands are audited.
%ghost /etc/audit/rules.d/40-sos-storage.rules %ghost /etc/audit/rules.d/40-sos-storage.rules
%changelog %changelog
* Fri Jul 14 2023 Jan Jansky <jjansky@redhat.com> = 4.5.5-2
- Adding patch for mac obfuscation
Resolves: bz2218279
Resolves: bz2216608
Resolves: bz2207562
* Mon Jul 03 2023 Jan Jansky <jjansky@redhat.com> = 4.5.5-1 * Mon Jul 03 2023 Jan Jansky <jjansky@redhat.com> = 4.5.5-1
- [clean] Respect permissions of sanitised files - [clean] Respect permissions of sanitised files
Resolves: bz2218279 Resolves: bz2218279