-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fixed gitlab detector #4371
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?
Fixed gitlab detector #4371
Conversation
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.
Minor (non-blocking) suggestions.
for _, endpoint := range s.Endpoints() { | ||
s1 := detectors.Result{ | ||
DetectorType: detectorspb.DetectorType_Gitlab, | ||
Raw: []byte(resMatch), |
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 a single data string, if we have 2 set of credentials and only 2nd endpoint is correct, it would not be possible to identify why one result is verified and the other is not.
Raw: []byte(resMatch), | |
Raw: []byte(resMatch), | |
RawV2: []byte(resMatch + endpoint), | |
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.
I had considered this change but hesitated, concerned it might duplicate existing results in the Enterprise.
I think @rosecodym can comment better on this change.
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.
Yup, you're right. Raw/RawV2 is like a primary key, and updating it even slightly can have impacts on the enterprise data, so let's not touch that. Instead, we can store the endpoint in the extra data.
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.
This could cause problems in diagnosing issues later on in enterprise too. This just might require migration.
Also, I'm positive that "adding" a RawV2 won't require migration
@rosecodym awaiting your response.
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.
Yes, adding a RawV2 that wasn't there before is fine and won't affect the deduplication fingerprinting.
Changing Raw or RawV2 will cause issues though.
Description:
Fixes: #4370
Checklist:
make test-community
)?make lint
this requires golangci-lint)?