diff options
author | Jake Hunsaker <jhunsake@redhat.com> | 2021-03-26 11:12:33 -0400 |
---|---|---|
committer | Jake Hunsaker <jhunsake@redhat.com> | 2021-04-05 14:09:06 -0400 |
commit | b27140a9126ea82efb517d60bf1b8455aaf4f5a6 (patch) | |
tree | d1e79225fb4f93c36e41ca617d0b078cd29b7c89 | |
parent | d607f5d9008e9890d1ec17eeba52fb58ca8216c2 (diff) | |
download | sos-b27140a9126ea82efb517d60bf1b8455aaf4f5a6.tar.gz |
[cleaner] Only skip packaging-based files for the IP parser
Files primarily containing package information, e.g. `installed-rpms` or
`installed-debs`, were previously being skipped by all parsers. In
reality, we only need to skip these for the IP parser due to the fact
that version numbers often generate a match for IP address regexes.
This will also fix a problem where if a system was the build host for
certain packages, the hostname would remain in these files as the
hostname parser was previously not checking these files.
Closes: #2400
Resolves: #2464
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r-- | sos/cleaner/obfuscation_archive.py | 10 | ||||
-rw-r--r-- | sos/cleaner/parsers/ip_parser.py | 16 |
2 files changed, 16 insertions, 10 deletions
diff --git a/sos/cleaner/obfuscation_archive.py b/sos/cleaner/obfuscation_archive.py index 981cc05f..84ca30cd 100644 --- a/sos/cleaner/obfuscation_archive.py +++ b/sos/cleaner/obfuscation_archive.py @@ -59,20 +59,10 @@ class SoSObfuscationArchive(): Returns: list of files and file regexes """ return [ - 'installed-debs', - 'installed-rpms', - 'sos_commands/dpkg', - 'sos_commands/python/pip_list', - 'sos_commands/rpm', - 'sos_commands/yum/.*list.*', - 'sos_commands/snappy/snap_list_--all', - 'sos_commands/snappy/snap_--version', - 'sos_commands/vulkan/vulkaninfo', 'sys/firmware', 'sys/fs', 'sys/kernel/debug', 'sys/module', - 'var/log/.*dnf.*', r'.*\.tar$', # TODO: support archive unpacking # Be explicit with these tar matches to avoid matching commands r'.*\.tar\.xz', diff --git a/sos/cleaner/parsers/ip_parser.py b/sos/cleaner/parsers/ip_parser.py index 3ea7f865..08d1cd05 100644 --- a/sos/cleaner/parsers/ip_parser.py +++ b/sos/cleaner/parsers/ip_parser.py @@ -24,6 +24,22 @@ class SoSIPParser(SoSCleanerParser): # don't match package versions recorded in journals r'.*dnf\[.*\]:' ] + + skip_files = [ + # skip these as version numbers will frequently look like IP addresses + # when using regex matching + 'installed-debs', + 'installed-rpms', + 'sos_commands/dpkg', + 'sos_commands/python/pip_list', + 'sos_commands/rpm', + 'sos_commands/yum/.*list.*', + 'sos_commands/snappy/snap_list_--all', + 'sos_commands/snappy/snap_--version', + 'sos_commands/vulkan/vulkaninfo', + 'var/log/.*dnf.*' + ] + map_file_key = 'ip_map' prep_map_file = 'sos_commands/networking/ip_-o_addr' |