Skip to content

Find, verify, and analyze leaked credentials

Browserstack regex (#808)

rahuljaisinghani3645a6e7b96a
diff --git a/pkg/detectors/browserstack/browserstack.go b/pkg/detectors/browserstack/browserstack.go
index 61e5b23ea..a43efefd6 100644
--- a/pkg/detectors/browserstack/browserstack.go
+++ b/pkg/detectors/browserstack/browserstack.go
@@ -20,8 +20,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{"browserstack"}) + `\b([0-9a-zA-Z]{20})\b`)
- userPat = regexp.MustCompile(detectors.PrefixRegex([]string{"browserstack"}) + `\b([0-9a-zA-Z]{3,10}_[0-9a-zA-Z]{6})\b`)
+ keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"browserstack","key","automate","local"}) + `\b([0-9a-zA-Z]{20})\b`)
+ userPat = regexp.MustCompile(detectors.PrefixRegex([]string{"browserstack","user","automate","local"}) + `\b(^[a-zA-Z\d]+([._-]?[a-zA-Z\d]+)*[a-zA-Z\d]+$)\b`)
)
// Keywords are used for efficiently pre-filtering chunks.