aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Castillo <jcastillo@redhat.com>2021-02-02 14:16:57 +0100
committerJake Hunsaker <jhunsake@redhat.com>2021-02-03 12:25:10 -0500
commitc753bc0841ea5a21304369ed07884e93d3332c01 (patch)
tree51e5d5b4b4b73ed409fb7b85b0457c2cecb6569a
parent08205690943497ece1c778e3d0c3a830a21a4f90 (diff)
downloadsos-c753bc0841ea5a21304369ed07884e93d3332c01.tar.gz
[yum] Mask the proxy passwords in /etc/yum.repos.d/
This patch makes sure that all passwords specified in the opcion proxy_password in any file inside /etc/yum.repos.d/ ends up masked in the sosreport. Closes: #2394 Resolves: #2396 Signed-off-by: Jose Castillo <jcastillo@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/report/plugins/yum.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/sos/report/plugins/yum.py b/sos/report/plugins/yum.py
index 6483dcd5..743c4af8 100644
--- a/sos/report/plugins/yum.py
+++ b/sos/report/plugins/yum.py
@@ -109,4 +109,9 @@ class Yum(Plugin, RedHatPlugin):
except IndexError:
pass
+ def postproc(self):
+ regexp = r"(proxy_password(\s)*=(\s)*)(\S+)\n"
+ repl = r"\1********\n"
+ self.do_path_regex_sub("/etc/yum.repos.d/*", regexp, repl)
+
# vim: set et ts=4 sw=4 :