aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2014-06-21 16:45:59 +0100
committerBryn M. Reeves <bmr@redhat.com>2014-06-21 16:45:59 +0100
commit772a953a30c75a0f4aa4e0554ab840ea54670d33 (patch)
treef751edb1adeee1b246a1f3a7133823b7a258b756
parent1b01fbc234f02c964deeffb866060e563c072c5b (diff)
downloadsos-772a953a30c75a0f4aa4e0554ab840ea54670d33.tar.gz
[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 <bmr@redhat.com>
-rw-r--r--sos/plugins/anaconda.py13
1 files 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