aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2020-12-14 10:53:03 +0100
committerJake Hunsaker <jhunsake@redhat.com>2020-12-15 12:55:16 -0500
commit1216f5a3247b6d23aafd2f2df178fa7aa8224743 (patch)
tree8bd6ea1458833e9b0bb395df0c3dc06c6b727487
parent15e54577289a29e72c636f8987859e91c3a55a7c (diff)
downloadsos-1216f5a3247b6d23aafd2f2df178fa7aa8224743.tar.gz
[subscription_manager] scrub passwords on one line only
Fix regexp to scrub proxy_password on one line and don't obfuscate subsequent line when the password is empty. Closes: #2328 Resolves: #2343 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/report/plugins/subscription_manager.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sos/report/plugins/subscription_manager.py b/sos/report/plugins/subscription_manager.py
index 9de595cf..85e735d5 100644
--- a/sos/report/plugins/subscription_manager.py
+++ b/sos/report/plugins/subscription_manager.py
@@ -45,8 +45,8 @@ class SubscriptionManager(Plugin, RedHatPlugin):
self.add_cmd_output(["rct cat-cert %s" % cert for cert in certs])
def postproc(self):
- passwdreg = r"(proxy_password(\s)*=(\s)*)(.*)"
- repl = r"\1 ********"
+ passwdreg = r"(proxy_password(\s)*=(\s)*)(\S+)\n"
+ repl = r"\1********\n"
self.do_path_regex_sub("/etc/rhsm/rhsm.conf", passwdreg, repl)
# vim: et ts=4 sw=4