mirror of
https://github.com/OpenKMIP/PyKMIP.git
synced 2025-07-21 13:04:22 +02:00
Merge pull request #457 from tipabu/secure-logging
Secure logging by default
This commit is contained in:
commit
1365047dcb
@ -47,6 +47,10 @@ class ConfigHelper(object):
|
||||
|
||||
def __init__(self, path=None):
|
||||
self.logger = logging.getLogger(__name__)
|
||||
# DEBUG logging here may expose passwords, so log at INFO by default.
|
||||
# However, if consumers know the risks, let them go ahead and override.
|
||||
if self.logger.level == logging.NOTSET:
|
||||
self.logger.setLevel(logging.INFO)
|
||||
|
||||
self.conf = SafeConfigParser()
|
||||
|
||||
|
@ -27,6 +27,10 @@ class KMIPProtocol(object):
|
||||
def __init__(self, socket, buffer_size=1024):
|
||||
self.socket = socket
|
||||
self.logger = logging.getLogger(__name__)
|
||||
# DEBUG logging here may expose secrets, so log at INFO by default.
|
||||
# However, if consumers know the risks, let them go ahead and override.
|
||||
if self.logger.level == logging.NOTSET:
|
||||
self.logger.setLevel(logging.INFO)
|
||||
|
||||
def write(self, data):
|
||||
if len(data) > 0:
|
||||
|
Loading…
x
Reference in New Issue
Block a user