Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #48105: Add word boundaries to prevent over-masking in SecretsMasker #48194

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

amarlearning
Copy link
Contributor

closes: #48105

Fix over-masking in SecretsMasker by adding word boundaries to pattern matching.

Before:

{
  "field_with_password_inside": "my***file",
  "normal_value": "v***lue"  # if 'a' was marked sensitive
}

After:

{
  "field_with_password_inside": "mypasswordfile",
  "normal_value": "value",
  "api_key": "***"  # only masks when key is sensitive
}

Move regex pattern with word boundaries to replacer compilation to maintain
clean implementation while preventing substring matches.
@amarlearning
Copy link
Contributor Author

Ready for review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Secrets Masker also applies masking to fields not in scope
1 participant