rtemstoolkit: Filter mail options from log output

This filters mail-related options out before logging the command line
options. This is needed to prevent leaking potentially sensitive
information via logs and emails.

Updates #4384
This commit is contained in:
Alex White
2021-04-09 16:52:44 -05:00
committed by Joel Sherrill
parent 1a575af817
commit 92f7f67297

View File

@@ -508,7 +508,22 @@ class command_line(object):
return None
def log_info(self):
log.output(log.info(self.argv))
# Filter potentially sensitive mail options out.
filtered_args = [
arg for arg in self.argv
if all(
smtp_opt not in arg
for smtp_opt in [
'--smtp-host',
'--mail-to',
'--mail-from',
'--smtp-user',
'--smtp-password',
'--smtp-port'
]
)
]
log.output(log.info(filtered_args))
def load(opts):
"""