-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Regex boundary clean and various tweaks to reduce FPs (part 1) #2407
Conversation
@@ -20,8 +21,8 @@ var ( | |||
client = common.SaneHttpClient() | |||
|
|||
// Make sure that your group is surrounded in boundary characters such as below to reduce false positives. | |||
appPat = regexp.MustCompile(detectors.PrefixRegex([]string{"datadog", "dd"}) + `\b([a-zA-Z-0-9]{40})\b`) | |||
apiPat = regexp.MustCompile(detectors.PrefixRegex([]string{"datadog", "dd"}) + `\b([a-zA-Z-0-9]{32})\b`) | |||
appPat = regexp.MustCompile(detectors.PrefixRegex([]string{"datadog", "dd_", "dd-"}) + `\b([a-zA-Z-0-9]{40})\b`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the reviewer: I don't feel super strongly on this change. However it does seem like dd
alone could introduce a fair number of FPs. Open for discussion!
@@ -21,8 +22,8 @@ var ( | |||
client = common.SaneHttpClient() | |||
|
|||
// Make sure that your group is surrounded in boundary characters such as below to reduce false positives. | |||
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"dovico"}) + `\b([0-9a-z]{32}\.[0-9a-z]{1,}\b)`) | |||
userPat = regexp.MustCompile(detectors.PrefixRegex([]string{"dovico"}) + `\b([0-9a-z]{32}\.[0-9a-z]{1,}\b)`) | |||
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"dovico"}) + `\b([0-9a-z]{32}\.[0-9a-z]{1,100})\b`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the reviewer: probably not gonna go past 100 alphanums on the backend here but 🤷🏻 I'm open for discussion
Going to close this PR and start fresh. After doing some testing some of these |
Description:
Adds better regex boundaries and includes various tweaks to reduce FPs
Checklist:
make test-community
)?make lint
this requires golangci-lint)?