Skip to content

Conversation

@incogbyte
Copy link

Limits regex to 20 chars (prefix + 16)
(\b) to improve and not grep big strings ( false positive )

Limits regex to 20 chars (prefix + 16)
 (\b) to improve and not grep big strings ( false positive )
@auto-assign auto-assign bot requested a review from edoardottt July 3, 2025 12:10
@edoardottt edoardottt self-assigned this Jul 8, 2025
@edoardottt edoardottt added enhancement New feature or request Go labels Jul 8, 2025
Copy link
Owner

@edoardottt edoardottt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @incogbyte , really appreciated. A comment reasoning about proposed changes.

"AWS Access Key",
"AWS Access Key",
*regexp.MustCompile(`(A3T[A-Z0-9]|AKIA|ACCA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA|ASCA|APKA)[A-Z0-9]{16}`),
*regexp.MustCompile(`\b(A3T[A-Z0-9]|AKIA|ACCA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA|ASCA|APKA)[A-Z0-9]{16}\b`),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it would be an improvement... I mean yes on avoiding the false positives, but then for example if there is something like fooAKIAEXAMPLEKEY1234bar it won't be noticed. Could be also in a minified JS script.

"AWS MWS Key",
"AWS MWS Key",
*regexp.MustCompile(`amzn\.mws\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}`),
*regexp.MustCompile(`\bamzn\.mws\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b`),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as before

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

Labels

enhancement New feature or request Go

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants