aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2020-07-17 22:25:07 +0200
committerJake Hunsaker <jhunsake@redhat.com>2020-07-20 15:57:28 -0400
commit063273cb43d9b641d48fcf160d1e993154d7ce3f (patch)
treed7a4a8d2e1b56f9d653ccb232037b5507aab3a80
parent4be4e4eae3ae070e25e69611fed3e5ee8493ad73 (diff)
downloadsos-063273cb43d9b641d48fcf160d1e993154d7ce3f.tar.gz
[foreman] scrub admin init password in installer logs
Obfuscate several instances of passwords: "--foreman-initial-admin-password", "mySecret", +candlepin.amqp.keystore_password=secretHash1 +jpa.config.hibernate.connection.password=secretHash2 by enhancing the scrubbing of: --password='secretPwd' Closes: #2156 Resolves: #2157 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/report/plugins/foreman.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/sos/report/plugins/foreman.py b/sos/report/plugins/foreman.py
index 034e86d3..e278b868 100644
--- a/sos/report/plugins/foreman.py
+++ b/sos/report/plugins/foreman.py
@@ -283,11 +283,11 @@ class Foreman(Plugin):
"/var/log/foreman-installer/sat*",
sat_debug_reg,
r"\1 \2 ********")
- # also hide passwords in yet different format
+ # also hide passwords in yet different formats
self.do_path_regex_sub(
"/var/log/foreman-installer/sat*",
- r"--password=(\S*)",
- r"--password=********")
+ r"(\.|_|-)password(=\'|=|\", \")(\w*)",
+ r"\1password\2********")
self.do_path_regex_sub(
"/var/log/foreman-installer/foreman-proxy*",
r"(\s*proxy_password\s=) (.*)",