|
|
3d26a2 |
From 706e523d608b588cfd70b2dfa957feafe0645796 Mon Sep 17 00:00:00 2001
|
|
|
3d26a2 |
From: Rohan Kanade <rkanade@redhat.com>
|
|
|
3d26a2 |
Date: Mon, 15 Jun 2015 20:24:10 +0530
|
|
|
3d26a2 |
Subject: [PATCH] [openstack_sahara] redact secrets from sahara configuration
|
|
|
3d26a2 |
|
|
|
3d26a2 |
Signed-off-by: Rohan Kanade <rkanade@redhat.com>
|
|
|
3d26a2 |
---
|
|
|
3d26a2 |
sos/plugins/openstack_sahara.py | 11 +++++++++++
|
|
|
3d26a2 |
1 files changed, 11 insertions(+), 0 deletions(-)
|
|
|
3d26a2 |
|
|
|
3d26a2 |
diff --git a/sos/plugins/openstack_sahara.py b/sos/plugins/openstack_sahara.py
|
|
|
3d26a2 |
index f0b95e4..9d971ba 100644
|
|
|
3d26a2 |
--- a/sos/plugins/openstack_sahara.py
|
|
|
3d26a2 |
+++ b/sos/plugins/openstack_sahara.py
|
|
|
3d26a2 |
@@ -31,6 +31,17 @@ class OpenStackSahara(Plugin):
|
|
|
3d26a2 |
if self.get_option("log"):
|
|
|
3d26a2 |
self.add_copy_spec("/var/log/sahara/")
|
|
|
3d26a2 |
|
|
|
3d26a2 |
+ def postproc(self):
|
|
|
3d26a2 |
+ protect_keys = [
|
|
|
3d26a2 |
+ 'memcache_secret_key', 'qpid_password', 'rabbit_password',
|
|
|
3d26a2 |
+ 'admin_password', 'password', 'ssl_key_password',
|
|
|
3d26a2 |
+ 'admin_token', 'connection'
|
|
|
3d26a2 |
+ ]
|
|
|
3d26a2 |
+
|
|
|
3d26a2 |
+ regexp = r"((?m)^\s*#*(%s)\s*=\s*)(.*)" % "|".join(protect_keys)
|
|
|
3d26a2 |
+
|
|
|
3d26a2 |
+ self.do_file_sub('/etc/sahara/sahara.conf', regexp, r"\1*********")
|
|
|
3d26a2 |
+
|
|
|
3d26a2 |
|
|
|
3d26a2 |
class DebianOpenStackSahara(OpenStackSahara, DebianPlugin, UbuntuPlugin):
|
|
|
3d26a2 |
"""OpenStackSahara related information for Debian based distributions."""
|
|
|
3d26a2 |
--
|
|
|
3d26a2 |
1.7.1
|
|
|
3d26a2 |
|