-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[feat] LambdaTest Credential Detector #4208
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
base: main
Are you sure you want to change the base?
Conversation
// Keywords are used for efficiently pre-filtering chunks. | ||
// Use identifiers in the secret preferably, or the provider name. | ||
func (s Scanner) Keywords() []string { | ||
return []string{"lambdatest", "LT_"} |
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.
LT_
might yield a significant amount of false matches, a lot of unnecessary chunks inputs might get filtered in.
|
||
s1 := detectors.Result{ | ||
DetectorType: detectorspb.DetectorType_LambdaTest, | ||
Raw: []byte(fmt.Sprintf("%s:%s", usernameMatch, accessKeyMatch)), |
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.
Could you add a value for RawV2
as well? It should be the same value
|
||
isVerified, extraData, verificationErr := verifyMatch(ctx, client, usernameMatch, accessKeyMatch) | ||
s1.Verified = isVerified | ||
s1.ExtraData = extraData |
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.
There doesn't seem to be any extraData
being returned by verifyMatch
.
We can also remove map[string]string
from the return types and update the return statements.
return true, nil, nil | ||
case http.StatusUnauthorized: | ||
// The secret is determinately not verified (nothing to do) | ||
return false, nil, fmt.Errorf("access key not present in db or invalid") |
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.
In cases where we determinately unverify credentials, we should return a nil
error, since errors imply issues in the verification process or indeterminate results.
Description:
LambdaTest is a cloud-based cross-browser testing platform that allows developers to test their web applications across various browsers and devices. This relates to issue : #4181
This feature enables detection of username and access key of LambdaTest based on its pattern and verifies the credentials as well by sending a request to the endpoint.
Checklist:
make test-community
)?make lint
this requires golangci-lint)?