commit 17e41d4d3c508001f1b2c048822be1a68d7d7a83 Author: Bryn M. Reeves Date: Mon Aug 12 20:14:51 2013 +0100 Add new plug-in to gather OpenHPI configuration New plug-in to collect OpenHPI configuration files. These files may contain passwords; a regex substitution rule has been added based on information from the reporter but this needs testing with a range of actual configuration files. Signed-off-by: Bryn M. Reeves diff --git a/sos/plugins/openhpi.py b/sos/plugins/openhpi.py new file mode 100644 index 0000000..8a84eeb --- /dev/null +++ b/sos/plugins/openhpi.py @@ -0,0 +1,34 @@ +### This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. + +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +import sos.plugintools + +class openhpi(sos.plugintools.PluginBase): + """OpenHPI related information + """ + + def setup(self): + self.addCopySpecs([ + "/etc/openhpi/openhpi.conf", + "/etc/openhpi/openhpiclient.conf" + ]) + + def postproc(self): + self.doRegexSub("/etc/openhpi/openhpi.conf" + r'([Pp]assw(or)?d|[Pp]assphrase)[[:space:]]+\=[[:space:]]"(.*)"', + r"\1******") + self.doRegexSub("/etc/openhpi/openhpiclient.conf" + r'([Pp]assw(or)?d|[Pp]assphrase)[[:space:]]+\=[[:space:]]"(.*)"', + r"\1******") +