Skip to content

Commit

Permalink
[INSPEC-414] collect .exp.sed for analysis (#3869)
Browse files Browse the repository at this point in the history
- see INSPEC-414

Signed-off-by: Xiangce Liu <[email protected]>
  • Loading branch information
xiangce authored Aug 3, 2023
1 parent f9c48b2 commit 2e8b122
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
11 changes: 8 additions & 3 deletions insights/client/data_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions insights/specs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions insights/specs/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 2e8b122

Please sign in to comment.