Changeset 6759c3c in rtems-tools


Ignore:
Timestamp:
04/09/21 21:52:44 (22 months ago)
Author:
Alex White <alex.white@…>
Branches:
5
Children:
a7efe4a
Parents:
56779ec
git-author:
Alex White <alex.white@…> (04/09/21 21:52:44)
git-committer:
Joel Sherrill <joel@…> (12/16/21 21:26:39)
Message:

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 #4553

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rtemstoolkit/options.py

    r56779ec r6759c3c  
    509509
    510510    def log_info(self):
    511         log.output(log.info(self.argv))
     511        # Filter potentially sensitive mail options out.
     512        filtered_args = [
     513            arg for arg in self.argv
     514            if all(
     515                smtp_opt not in arg
     516                for smtp_opt in [
     517                    '--smtp-host',
     518                    '--mail-to',
     519                    '--mail-from',
     520                    '--smtp-user',
     521                    '--smtp-password',
     522                    '--smtp-port'
     523                ]
     524            )
     525        ]
     526        log.output(log.info(filtered_args))
    512527
    513528def load(opts):
Note: See TracChangeset for help on using the changeset viewer.