Sophie

Sophie

distrib > Fedora > 19 > x86_64 > by-pkgid > 2183d0e55a8d454b8164909066cf1904 > files > 74

sos-3.1-1.fc19.src.rpm

From e1e324b63a28a4ed83f898d9297ae85ffb714622 Mon Sep 17 00:00:00 2001
From: "Bryn M. Reeves" <bmr@redhat.com>
Date: Mon, 2 Jun 2014 14:55:03 +0100
Subject: [PATCH 75/77] Elide bootloader password in grub plugin

The grub.conf configuration file collected by the grub plugin may
contain a plaintext or md5 hashed bootloader password. Add a regex
substitution for all files matching '.*\/grub\.conf' and replace
the password with '*'s.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
---
 sos/plugins/grub.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sos/plugins/grub.py b/sos/plugins/grub.py
index 3911041..33b9f7a 100644
--- a/sos/plugins/grub.py
+++ b/sos/plugins/grub.py
@@ -30,4 +30,11 @@ class Grub(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
             "/etc/grub.d"
         ])
 
+    def postproc(self):
+        self.do_path_regex_sub(
+            r".*\/grub.conf",
+            r"(password)\s(--md5)\s(.*)",
+            r"\1 \2 ********"
+        )
+
 # vim: et ts=4 sw=4
-- 
1.9.3