Skip to content

Find, verify, and analyze leaked credentials

Update sentry endpoint (#3983)

Zachary Rice14645c98471a
diff --git a/pkg/detectors/sentrytoken/v1/sentrytoken.go b/pkg/detectors/sentrytoken/v1/sentrytoken.go
index c3b03e3a5..c16cf67ab 100644
--- a/pkg/detectors/sentrytoken/v1/sentrytoken.go
+++ b/pkg/detectors/sentrytoken/v1/sentrytoken.go
@@ -81,7 +81,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
func VerifyToken(ctx context.Context, client *http.Client, token string) (map[string]string, bool, error) {
// api docs: https://docs.sentry.io/api/organizations/
// this api will return 200 for user auth tokens with scope of org:<>
- req, err := http.NewRequestWithContext(ctx, http.MethodGet, "https://sentry.io/api/0/organizations/", nil)
+ req, err := http.NewRequestWithContext(ctx, http.MethodGet, "https://sentry.io/api/0/auth/validate/", nil)
if err != nil {
return nil, false, err
}
@@ -98,17 +98,7 @@ func VerifyToken(ctx context.Context, client *http.Client, token string) (map[st
switch resp.StatusCode {
case http.StatusOK:
- var organizations []Organization
- if err = json.NewDecoder(resp.Body).Decode(&organizations); err != nil {
- return nil, false, err
- }
-
- var extraData = make(map[string]string)
- for _, org := range organizations {
- extraData[fmt.Sprintf("orginzation_%s", org.ID)] = org.Name
- }
-
- return extraData, true, nil
+ return nil, true, nil
case http.StatusForbidden:
var APIResp interface{}
if err = json.NewDecoder(resp.Body).Decode(&APIResp); err != nil {
diff --git a/pkg/detectors/sentrytoken/v1/sentrytoken_integration_test.go b/pkg/detectors/sentrytoken/v1/sentrytoken_integration_test.go
index 58c2e0264..158830ee5 100644
--- a/pkg/detectors/sentrytoken/v1/sentrytoken_integration_test.go
+++ b/pkg/detectors/sentrytoken/v1/sentrytoken_integration_test.go
@@ -52,7 +52,6 @@ func TestSentryToken_FromChunk(t *testing.T) {
{
DetectorType: detectorspb.DetectorType_SentryToken,
Verified: true,
- ExtraData: map[string]string{"orginzation_4508567357947904": "Truffle Security"},
},
},
wantErr: false,
diff --git a/pkg/detectors/sentrytoken/v2/sentrytoken_integration_test.go b/pkg/detectors/sentrytoken/v2/sentrytoken_integration_test.go
index 626a8bbdb..2ea77da02 100644
--- a/pkg/detectors/sentrytoken/v2/sentrytoken_integration_test.go
+++ b/pkg/detectors/sentrytoken/v2/sentrytoken_integration_test.go
@@ -52,7 +52,6 @@ func TestSentryToken_FromChunk(t *testing.T) {
{
DetectorType: detectorspb.DetectorType_SentryToken,
Verified: true,
- ExtraData: map[string]string{"orginzation_4508567357947904": "Truffle Security"},
},
},
wantErr: false,