commit 8813b874b5e1a3898aef0523c8a6852464b98dbb Author: Bryn M. Reeves Date: Fri May 23 17:11:00 2014 +0100 Add distupgrade plugin Add a new plugin to collect data relating to completed or attempted distribution upgrades. Currently supports the Red Hat set of tools and files but other distributions can supply their own filelists or override setup() to perform other distribution specific actions. Signed-off-by: Bryn M. Reeves diff --git a/sos/plugins/distupgrade.py b/sos/plugins/distupgrade.py new file mode 100755 index 0000000..f26a3cb --- /dev/null +++ b/sos/plugins/distupgrade.py @@ -0,0 +1,47 @@ +## Copyright (C) 2014 Red Hat, Inc., Bryn M. Reeves + +### 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 distupgrade(sos.plugintools.PluginBase): + """Distribution upgrade information + """ + + packages = [ + 'preupgrade-assistant', + 'redhat-upgrade-tool' + ] + + def setup(self): + self.addCopySpecs([ + '/root/preupgrade/kickstart', + '/root/preupgrade/result.html', + '/root/preupgrade/result.xml', + '/root/preupgrade/RHEL6_7/all-xccdf.xml', + '/var/log/redhat_upgrade_tool.log', + '/var/log/preupgrade/preupg.log', + '/var/log/preupgrade/ui.log', + '/var/cache/preupgrade/common' + ]) + return + + def postproc(self): + self.doRegexSub( + "/root/preupgrade/kickstart/anaconda-ks.cfg", + r"(\s*rootpw\s*).*", + r"\1********" + ) + commit 02a6afc5ad9d1dcff39582d20752e99fcba7c4b6 Author: Bryn M. Reeves Date: Mon Jun 9 14:34:10 2014 +0100 Add path redaction to distupgrade plugin The preupgrade-assistant package stores listings of user home directory content in /var/cache/preupgrade/allmyfiles.log: [...] /etc/yum/vars /etc/yum/version-groups.conf /home /home/bmr /home/bmr/.bash_logout /home/bmr/.bash_profile /home/bmr/.bashrc /home/bmr/.cache /home/bmr/.cache/event-sound-cache.tdb.5a13c21f03268e5eedd52b3000000017.x86_64-redhat-linux-gnu /home/bmr/.config /home/bmr/.config/gnome-disk-utility [...] Since file and directory names in these locations could be considered sensitive by some users redact all paths beneath /home in this file: [...] /etc/yum/vars /etc/yum/version-groups.conf /home /home/******** path redacted ******** /home/******** path redacted ******** [...] Signed-off-by: Bryn M. Reeves diff --git a/sos/plugins/distupgrade.py b/sos/plugins/distupgrade.py index f26a3cb..772541d 100755 --- a/sos/plugins/distupgrade.py +++ b/sos/plugins/distupgrade.py @@ -45,3 +45,9 @@ class distupgrade(sos.plugintools.PluginBase): r"\1********" ) + self.doRegexSub( + "/var/cache/preupgrade/common/allmyfiles.log", + r"\/home\/.*", + r"/home/******** path redacted ********" + ) + commit 7dacc2bea09f2e3d4e8fe387c2a2139eb9426b4d Author: Bryn M. Reeves Date: Mon Jun 9 15:05:36 2014 +0100 Add more path redaction to distupgrade plugin The preupgrade-assistant duplicates user home directory listings in the file /root/preupgrade/kickstart/untrackeduser. Also apply redactions to path names at this location. Signed-off-by: Bryn M. Reeves diff --git a/sos/plugins/distupgrade.py b/sos/plugins/distupgrade.py index 772541d..d6d9098 100755 --- a/sos/plugins/distupgrade.py +++ b/sos/plugins/distupgrade.py @@ -46,6 +46,12 @@ class distupgrade(sos.plugintools.PluginBase): ) self.doRegexSub( + "/root/preupgrade/kickstart/untrackeduser", + r"\/home\/.*", + r"/home/******** path redacted ********" + ) + + self.doRegexSub( "/var/cache/preupgrade/common/allmyfiles.log", r"\/home\/.*", r"/home/******** path redacted ********"