Skip to content

Commit fc2df9c

Browse files
committed
[foremanctl] Enable plugin for containerized deployments
The plugin required foremanctl package which doesn't exist in containerized mode. Add container detection to enable the plugin and collect foremanctl health diagnostics for support cases. Signed-off-by: akumari <akumari@redhat.com>
1 parent 1feb6da commit fc2df9c

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

sos/report/plugins/foremanctl.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class Foremanctl(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
1919
plugin_name = 'foremanctl'
2020
profiles = ('sysmgmt',)
2121
packages = ('foremanctl', )
22+
containers = ('foreman',)
2223

2324
def setup(self):
2425
self.add_copy_spec([
@@ -29,14 +30,23 @@ def setup(self):
2930

3031
self.add_cmd_output([
3132
"foremanctl features",
33+
"foremanctl health",
3234
])
3335

3436
self.add_dir_listing(["/var/lib/foremanctl/"], recursive=True)
3537

3638
def postproc(self):
37-
self.do_path_regex_sub("/var/lib/foremanctl/parameters.yaml",
38-
r"(foreman_initial_admin_password:\s*)(.*)",
39-
r"\1********")
39+
# Scrub passwords, credentials, tokens, secrets, and keys
40+
self.do_path_regex_sub(
41+
"/var/lib/foremanctl/parameters.yaml",
42+
r"((.*)?(passw|cred|token|secret|key).*(\:\s|=))(.*)",
43+
r"\1********")
44+
45+
# Scrub passwords from foremanctl logs
46+
self.do_path_regex_sub(
47+
"/var/log/foremanctl/foremanctl.*log*",
48+
r"(((passw|cred|token|secret)=)|(password ))(.*)",
49+
r"\1********")
4050

4151

4252
# vim: set et ts=4 sw=4 :

0 commit comments

Comments
 (0)