-
Notifications
You must be signed in to change notification settings - Fork 191
RFC: Auto Mask Secrets #728
Copy link
Copy link
Closed
Labels
RFCTechnical design documents related to a feature requestTechnical design documents related to a feature requestneed-customer-feedbackRequires more customers feedback before making or revisiting a decisionRequires more customers feedback before making or revisiting a decisionon-holdThis item is on-hold and will be revisited in the futureThis item is on-hold and will be revisited in the futurerevisit-in-3-monthsBlocked issues/PRs that need to be revisitedBlocked issues/PRs that need to be revisited
Metadata
Metadata
Assignees
Labels
RFCTechnical design documents related to a feature requestTechnical design documents related to a feature requestneed-customer-feedbackRequires more customers feedback before making or revisiting a decisionRequires more customers feedback before making or revisiting a decisionon-holdThis item is on-hold and will be revisited in the futureThis item is on-hold and will be revisited in the futurerevisit-in-3-monthsBlocked issues/PRs that need to be revisitedBlocked issues/PRs that need to be revisited
Type
Projects
Status
Closed
Description of the feature request
Automatically mask secret or password values in extra data.
Problem statement
A best practice is to never log secrets or passwords. There are times when I have an object that might have one of these things in it. I'd like to be able to pass in the object without needing to pull out the secrets manually.
Summary of the feature
If turned on, any extra data passed into the logger would be looked at and secrets/passwords would be masked. Consider the following data.
The code would see a key that contains "password" (this could be a configurable regex with a default) and would replace it with something like "*****", resulting in the following extra data being logged.
No secrets in logs
Code examples
Benefits for you and the wider AWS community
Safer logging.
Describe alternatives you've considered
Creating a function that does this for me. The downside to this is twofold. One, I have to include the function call everywhere, so if I forget it I risk writing something I shouldn't to the logs. Two, the devex is slightly worse because I have to do something like
{ extraData: cleanExtraData(extraData) }instead of just{ extraData }Additional context
Related issues, RFCs