Closed
Description
Tell us about the problem you're trying to solve
Currently, we have multiple ways to expose credentials in logs (info, exceptions, tests)
Describe the solution you’d like
The only real way to secure credentials is to control logging output with a logging Formatter attached to the root logger.
This handler will get the connector's config and will replace all occurrence of values from fields marked as secret.
class SecureFormatter(logging.Formatter):
""" Custom formatter to prevent secrets leaking
"""
def format(self, record: 'logging.LogRecord') -> str:
msg = super().format(record)
for secret in secrets:
msg = msg.replace(secret, '***')
return msg
Describe the alternative you’ve considered or used
do manually
┆Issue is synchronized with this Asana task by Unito
Activity