From 772a953a30c75a0f4aa4e0554ab840ea54670d33 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Sat, 21 Jun 2014 16:45:59 +0100 Subject: [anaconda] elide passwords in kickstart user directives E.g.: useradd --password '$6$oIW3o2Mr$XbWZKaM7nA.cQqudfDJScupXOia5h1u517t6Htx/Q/MgXm82Pc/OcytatTeI4ULNWOMJzvpCigWiL4xKP9PX4.' test Signed-off-by: Bryn M. Reeves --- sos/plugins/anaconda.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/sos/plugins/anaconda.py b/sos/plugins/anaconda.py index e165ba77..d33f5abc 100644 --- a/sos/plugins/anaconda.py +++ b/sos/plugins/anaconda.py @@ -41,8 +41,15 @@ class Anaconda(Plugin, RedHatPlugin): self.add_copy_specs(paths) def postproc(self): - self.do_file_sub("/root/anaconda-ks.cfg", - r"(\s*rootpw\s*).*", - r"\1******") + self.do_file_sub( + "/root/anaconda-ks.cfg", + r"(\s*rootpw\s*).*", + r"\1********" + ) + self.do_file_sub( + "/root/anaconda-ks.cfg", + r"(useradd --password) (.*)", + r"\1 ********" + ) # vim: et ts=4 sw=4 -- cgit