Fix: Increase Entropy Requirement for Secret Redaction to Reduce False Positives (#6875)

This commit is contained in:
tofarr 2025-02-22 08:44:28 +00:00 committed by GitHub
parent e109f7e58e
commit a8bce3724f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -221,8 +221,10 @@ class SensitiveDataFilter(logging.Filter):
sensitive_values = []
for key, value in os.environ.items():
key_upper = key.upper()
if len(value) > 2 and any(
s in key_upper for s in ('SECRET', 'KEY', 'CODE', 'TOKEN')
if (
len(value) > 2
and value != 'default'
and any(s in key_upper for s in ('SECRET', 'KEY', 'CODE', 'TOKEN'))
):
sensitive_values.append(value)