aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRohan Kanade <rkanade@redhat.com>2015-06-15 20:24:10 +0530
committerRohan Kanade <rkanade@redhat.com>2015-06-15 20:55:07 +0530
commit706e523d608b588cfd70b2dfa957feafe0645796 (patch)
treec772292a88299f89d69131517640b4b2af2ad5b9
parentfdc9480909b129fe218cad0f8b0e51fa68d5299c (diff)
downloadsos-706e523d608b588cfd70b2dfa957feafe0645796.tar.gz
[openstack_sahara] redact secrets from sahara configuration
Signed-off-by: Rohan Kanade <rkanade@redhat.com>
-rw-r--r--sos/plugins/openstack_sahara.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/sos/plugins/openstack_sahara.py b/sos/plugins/openstack_sahara.py
index f0b95e4a..9d971bad 100644
--- a/sos/plugins/openstack_sahara.py
+++ b/sos/plugins/openstack_sahara.py
@@ -31,6 +31,17 @@ class OpenStackSahara(Plugin):
if self.get_option("log"):
self.add_copy_spec("/var/log/sahara/")
+ def postproc(self):
+ protect_keys = [
+ 'memcache_secret_key', 'qpid_password', 'rabbit_password',
+ 'admin_password', 'password', 'ssl_key_password',
+ 'admin_token', 'connection'
+ ]
+
+ regexp = r"((?m)^\s*#*(%s)\s*=\s*)(.*)" % "|".join(protect_keys)
+
+ self.do_file_sub('/etc/sahara/sahara.conf', regexp, r"\1*********")
+
class DebianOpenStackSahara(OpenStackSahara, DebianPlugin, UbuntuPlugin):
"""OpenStackSahara related information for Debian based distributions."""