From 2e8b1226e223776b1ebf8b554ffa4a04c6302903 Mon Sep 17 00:00:00 2001 From: Xiangce Liu Date: Thu, 3 Aug 2023 12:22:18 +0800 Subject: [PATCH] [INSPEC-414] collect .exp.sed for analysis (#3869) - see INSPEC-414 Signed-off-by: Xiangce Liu --- insights/client/data_collector.py | 11 ++++++++--- insights/specs/__init__.py | 1 + insights/specs/default.py | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/insights/client/data_collector.py b/insights/client/data_collector.py index 4caa37f4e2..a80b7744a6 100644 --- a/insights/client/data_collector.py +++ b/insights/client/data_collector.py @@ -453,9 +453,14 @@ def redact(self, rm_conf): for dirpath, dirnames, filenames in os.walk(searchpath): for f in filenames: fullpath = os.path.join(dirpath, f) - if (fullpath.endswith('etc/insights-client/machine-id') or - fullpath.endswith('etc/machine-id') or - fullpath.endswith('insights_commands/subscription-manager_identity')): + if (fullpath.endswith( + ( + 'etc/insights-client/machine-id', + 'etc/insights-client/.exp.sed', # INSPEC-414 + 'etc/machine-id', + 'insights_commands/subscription-manager_identity' + ) + )): # do not redact the ID files continue redacted_contents = _process_content_redaction(fullpath, exclude, regex) diff --git a/insights/specs/__init__.py b/insights/specs/__init__.py index c652ac17f2..b702e41d0c 100644 --- a/insights/specs/__init__.py +++ b/insights/specs/__init__.py @@ -268,6 +268,7 @@ class Specs(SpecSet): initctl_lst = RegistryPoint() initscript = RegistryPoint(multi_output=True) insights_client_conf = RegistryPoint(filterable=True) + insights_client_exp_sed = RegistryPoint() # INSPEC-414 installed_rpms = RegistryPoint() interrupts = RegistryPoint() ip6tables = RegistryPoint() diff --git a/insights/specs/default.py b/insights/specs/default.py index bf6e8b9f20..ef5c83e30f 100644 --- a/insights/specs/default.py +++ b/insights/specs/default.py @@ -292,6 +292,7 @@ class DefaultSpecs(Specs): init_process_cgroup = simple_file("/proc/1/cgroup") initctl_lst = simple_command("/sbin/initctl --system list") insights_client_conf = simple_file('/etc/insights-client/insights-client.conf') + insights_client_exp_sed = simple_file('/etc/insights-client/.exp.sed') # INSPEC-414 installed_rpms = simple_command("/bin/rpm -qa --qf '%s'" % _rpm_format, context=HostContext, signum=signal.SIGTERM) interrupts = simple_file("/proc/interrupts") ip6tables = simple_command("/sbin/ip6tables-save")