[PATCH 1/2] Add new logger for sensitive information

Martin Kolman mkolman at redhat.com
Tue Aug 27 15:11:03 UTC 2013


Content that goes to the sensitive-info logger is not forwarded to any
other log and the logfile - sensitive-info.log - is not copied to the
installed system once installation is finished.

Like this, potentially sensitive information is available for debugging
once things go wrong during the installation, but only it the user
willingly decides to provide it.

Signed-off-by: Martin Kolman <mkolman at redhat.com>
---
 pyanaconda/anaconda_log.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/pyanaconda/anaconda_log.py b/pyanaconda/anaconda_log.py
index aa95046..e272167 100644
--- a/pyanaconda/anaconda_log.py
+++ b/pyanaconda/anaconda_log.py
@@ -43,6 +43,7 @@ PROGRAM_LOG_FILE = "/tmp/program.log"
 PROGRAM_LOG_TTY = "/dev/tty5"
 STORAGE_LOG_FILE = "/tmp/storage.log"
 PACKAGING_LOG_FILE = "/tmp/packaging.log"
+SENSITIVE_INFO_LOG_FILE = "/tmp/sensitive-info.log"
 ANACONDA_SYSLOG_FACILITY = SysLogHandler.LOG_LOCAL1
 
 from threading import Lock
@@ -134,6 +135,14 @@ class AnacondaLog:
                             minLevel=logging.DEBUG)
         self.forwardToSyslog(yum_logger)
 
+        # Create the sensitive information logger
+        # * the sensitive-info.log file is not copied to the installed
+        # system, as it might contain sensitive information that
+        # should not be persistently stored by default
+        sensitive_logger = logging.getLogger("sensitive-info")
+        self.addFileHandler(SENSITIVE_INFO_LOG_FILE, sensitive_logger,
+                            minLevel=logging.DEBUG)
+
         # Create a second logger for just the stuff we want to dup on
         # stdout.  Anything written here will also get passed up to the
         # parent loggers for processing and possibly be written to the
-- 
1.8.3.1



More information about the anaconda-patches mailing list