From 9f5db3cf5b59312aa85fb5b91c3ddeeeabe3842e Mon Sep 17 00:00:00 2001 From: David Paleino Date: Sat, 17 Dec 2011 07:55:18 +0100 Subject: [PATCH] Mask out sensitive information in the logfile --- wicd/configmanager.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wicd/configmanager.py b/wicd/configmanager.py index 9871dad..919e0e3 100644 --- a/wicd/configmanager.py +++ b/wicd/configmanager.py @@ -120,8 +120,13 @@ class ConfigManager(RawConfigParser): ret = to_unicode(ret) if default: if self.debug: - print ''.join(['found ', option, ' in configuration ', - str(ret)]) + # mask out sensitive information + if option in ['apsk', 'password', 'identity', 'private_key', \ + 'private_key_passwd', 'key', 'passphrase']: + print ''.join(['found ', option, ' in configuration *****']) + else: + print ''.join(['found ', option, ' in configuration ', + str(ret)]) else: if default != "__None__": print 'did not find %s in configuration, setting default %s' % (option, str(default))