|
|
629484 |
From c1e37e41831c8a9ce8c9901d604421b8b19a20e1 Mon Sep 17 00:00:00 2001
|
|
|
629484 |
From: "Bryn M. Reeves" <bmr@redhat.com>
|
|
|
629484 |
Date: Mon, 12 Aug 2013 20:11:29 +0100
|
|
|
629484 |
Subject: [PATCH 1/3] Add new plug-in to gather OpenHPI configuration
|
|
|
629484 |
|
|
|
629484 |
New plug-in to collect OpenHPI configuration files. These files
|
|
|
629484 |
may contain passwords; a regex substitution rule has been added
|
|
|
629484 |
based on information from the reporter but this needs testing
|
|
|
629484 |
with a range of actual configuration files.
|
|
|
629484 |
|
|
|
629484 |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
629484 |
---
|
|
|
629484 |
sos/plugins/openhpi.py | 34 ++++++++++++++++++++++++++++++++++
|
|
|
629484 |
1 file changed, 34 insertions(+)
|
|
|
629484 |
create mode 100644 sos/plugins/openhpi.py
|
|
|
629484 |
|
|
|
629484 |
diff --git a/sos/plugins/openhpi.py b/sos/plugins/openhpi.py
|
|
|
629484 |
new file mode 100644
|
|
|
629484 |
index 0000000..bb35206
|
|
|
629484 |
--- /dev/null
|
|
|
629484 |
+++ b/sos/plugins/openhpi.py
|
|
|
629484 |
@@ -0,0 +1,34 @@
|
|
|
629484 |
+### This program is free software; you can redistribute it and/or modify
|
|
|
629484 |
+## it under the terms of the GNU General Public License as published by
|
|
|
629484 |
+## the Free Software Foundation; either version 2 of the License, or
|
|
|
629484 |
+## (at your option) any later version.
|
|
|
629484 |
+
|
|
|
629484 |
+## This program is distributed in the hope that it will be useful,
|
|
|
629484 |
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
629484 |
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
629484 |
+## GNU General Public License for more details.
|
|
|
629484 |
+
|
|
|
629484 |
+## You should have received a copy of the GNU General Public License
|
|
|
629484 |
+## along with this program; if not, write to the Free Software
|
|
|
629484 |
+## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
629484 |
+
|
|
|
629484 |
+from sos.plugins import Plugin, RedHatPlugin
|
|
|
629484 |
+import os
|
|
|
629484 |
+
|
|
|
629484 |
+class OpenHPI(Plugin, RedHatPlugin):
|
|
|
629484 |
+ """OpenHPI related information
|
|
|
629484 |
+ """
|
|
|
629484 |
+
|
|
|
629484 |
+ plugin_name = 'openhpi'
|
|
|
629484 |
+
|
|
|
629484 |
+ def setup(self):
|
|
|
629484 |
+ self.add_copy_specs([
|
|
|
629484 |
+ "/etc/openhpi/openhpi.conf",
|
|
|
629484 |
+ "/etc/openhpi/openhpiclient.conf"
|
|
|
629484 |
+ ])
|
|
|
629484 |
+
|
|
|
629484 |
+ def postproc(self):
|
|
|
629484 |
+ self.do_file_sub("/etc/openhpi/openhpi.conf"
|
|
|
629484 |
+ r'([Pp]assw(or)?d|[Pp]assphrase)[[:space:]]+\=[[:space:]]"(.*)"',
|
|
|
629484 |
+ r"\1******")
|
|
|
629484 |
+
|
|
|
629484 |
--
|
|
|
629484 |
1.7.11.7
|
|
|
629484 |
|
|
|
629484 |
|
|
|
629484 |
From a2be6462e40acc48c4271b2faddc4e9a03187712 Mon Sep 17 00:00:00 2001
|
|
|
629484 |
From: "Bryn M. Reeves" <bmr@redhat.com>
|
|
|
629484 |
Date: Mon, 12 Aug 2013 20:15:25 +0100
|
|
|
629484 |
Subject: [PATCH 2/3] Add file substitution rule for openhpiclient.conf
|
|
|
629484 |
|
|
|
629484 |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
629484 |
---
|
|
|
629484 |
sos/plugins/openhpi.py | 3 +++
|
|
|
629484 |
1 file changed, 3 insertions(+)
|
|
|
629484 |
|
|
|
629484 |
diff --git a/sos/plugins/openhpi.py b/sos/plugins/openhpi.py
|
|
|
629484 |
index bb35206..a75f016 100644
|
|
|
629484 |
--- a/sos/plugins/openhpi.py
|
|
|
629484 |
+++ b/sos/plugins/openhpi.py
|
|
|
629484 |
@@ -31,4 +31,7 @@ class OpenHPI(Plugin, RedHatPlugin):
|
|
|
629484 |
self.do_file_sub("/etc/openhpi/openhpi.conf"
|
|
|
629484 |
r'([Pp]assw(or)?d|[Pp]assphrase)[[:space:]]+\=[[:space:]]"(.*)"',
|
|
|
629484 |
r"\1******")
|
|
|
629484 |
+ self.do_file_sub("/etc/openhpi/openhpiclient.conf"
|
|
|
629484 |
+ r'([Pp]assw(or)?d|[Pp]assphrase)[[:space:]]+\=[[:space:]]"(.*)"',
|
|
|
629484 |
+ r"\1******")
|
|
|
629484 |
|
|
|
629484 |
--
|
|
|
629484 |
1.7.11.7
|
|
|
629484 |
|
|
|
629484 |
|
|
|
629484 |
From a70afd9562a3ba9ad193fa25c6079c45533b9887 Mon Sep 17 00:00:00 2001
|
|
|
629484 |
From: "Bryn M. Reeves" <bmr@redhat.com>
|
|
|
629484 |
Date: Thu, 7 Nov 2013 18:17:18 +0000
|
|
|
629484 |
Subject: [PATCH 3/3] Fix regex substitution in openhpi plug-in
|
|
|
629484 |
|
|
|
629484 |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
629484 |
---
|
|
|
629484 |
sos/plugins/openhpi.py | 8 ++------
|
|
|
629484 |
1 file changed, 2 insertions(+), 6 deletions(-)
|
|
|
629484 |
|
|
|
629484 |
diff --git a/sos/plugins/openhpi.py b/sos/plugins/openhpi.py
|
|
|
629484 |
index a75f016..dbe004d 100644
|
|
|
629484 |
--- a/sos/plugins/openhpi.py
|
|
|
629484 |
+++ b/sos/plugins/openhpi.py
|
|
|
629484 |
@@ -28,10 +28,6 @@ class OpenHPI(Plugin, RedHatPlugin):
|
|
|
629484 |
])
|
|
|
629484 |
|
|
|
629484 |
def postproc(self):
|
|
|
629484 |
- self.do_file_sub("/etc/openhpi/openhpi.conf"
|
|
|
629484 |
- r'([Pp]assw(or)?d|[Pp]assphrase)[[:space:]]+\=[[:space:]]"(.*)"',
|
|
|
629484 |
- r"\1******")
|
|
|
629484 |
- self.do_file_sub("/etc/openhpi/openhpiclient.conf"
|
|
|
629484 |
- r'([Pp]assw(or)?d|[Pp]assphrase)[[:space:]]+\=[[:space:]]"(.*)"',
|
|
|
629484 |
- r"\1******")
|
|
|
629484 |
+ self.do_file_sub("/etc/openhpi/openhpi.conf",
|
|
|
629484 |
+ r'(\s*[Pp]ass.*\s*=\s*).*', r'\1********')
|
|
|
629484 |
|
|
|
629484 |
--
|
|
|
629484 |
1.7.11.7
|
|
|
629484 |
|