mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-10 15:14:38 +00:00
fix browserstack detector (#1120)
* fixing browserstack regex username detection * fixing browserstack regex username detection * fixing browserstack regex username detection * fix patterns * fix patterns --------- Co-authored-by: raju-bs <raju@browserstack.com> Co-authored-by: Dustin Decker <dustin@trufflesec.com>
This commit is contained in:
parent
9ef9e9870d
commit
d20f43b5c6
2 changed files with 4 additions and 2 deletions
|
@ -20,8 +20,8 @@ var (
|
||||||
client = common.SaneHttpClient()
|
client = common.SaneHttpClient()
|
||||||
|
|
||||||
// Make sure that your group is surrounded in boundary characters such as below to reduce false positives.
|
// Make sure that your group is surrounded in boundary characters such as below to reduce false positives.
|
||||||
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"browserstack", "key", "automate", "local"}) + `\b([0-9a-zA-Z]{20})\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`)
|
userPat = regexp.MustCompile(detectors.PrefixRegex([]string{"browserstack", "user", "automate", "local"}) + `\b([a-zA-Z\d]{3,18}[._-]+[a-zA-Z\d]{6})\b`)
|
||||||
)
|
)
|
||||||
|
|
||||||
// Keywords are used for efficiently pre-filtering chunks.
|
// Keywords are used for efficiently pre-filtering chunks.
|
||||||
|
|
|
@ -51,6 +51,7 @@ func TestBrowserStack_FromChunk(t *testing.T) {
|
||||||
{
|
{
|
||||||
DetectorType: detectorspb.DetectorType_BrowserStack,
|
DetectorType: detectorspb.DetectorType_BrowserStack,
|
||||||
Verified: true,
|
Verified: true,
|
||||||
|
RawV2: []byte(fmt.Sprintf("%s%s", secret, secretUser)),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
|
@ -67,6 +68,7 @@ func TestBrowserStack_FromChunk(t *testing.T) {
|
||||||
{
|
{
|
||||||
DetectorType: detectorspb.DetectorType_BrowserStack,
|
DetectorType: detectorspb.DetectorType_BrowserStack,
|
||||||
Verified: false,
|
Verified: false,
|
||||||
|
RawV2: []byte(fmt.Sprintf("%s%s", inactiveSecret, secretUser)),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
|
|
Loading…
Reference in a new issue