aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2019-10-23 10:14:34 +0200
committerJake Hunsaker <jhunsake@redhat.com>2019-10-23 12:35:45 -0400
commitca711063e27192c3021c8cb6eb46f3850dd02486 (patch)
tree3a6457f370fe91eda74c421575223247c66af3cb
parentbb8f125ffc46855c7ff1bdb67532b617cc0f2f9e (diff)
downloadsos-ca711063e27192c3021c8cb6eb46f3850dd02486.tar.gz
[subscription_manager] obfuscate proxy password in rhsm.conf
Obfuscate proxy password in /etc/rhsm/rhsm.conf on line: proxy_password = someSecret Resolves: #1837 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/plugins/subscription_manager.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/sos/plugins/subscription_manager.py b/sos/plugins/subscription_manager.py
index 8ee58cff..4c8e3a7c 100644
--- a/sos/plugins/subscription_manager.py
+++ b/sos/plugins/subscription_manager.py
@@ -42,4 +42,9 @@ class SubscriptionManager(Plugin, RedHatPlugin):
certs = glob.glob('/etc/pki/product-default/*.pem')
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 ********"
+ self.do_path_regex_sub("/etc/rhsm/rhsm.conf", passwdreg, repl)
+
# vim: et ts=4 sw=4