Skip to content

Find, verify, and analyze leaked credentials

Renamed AnypointOAuth2 detector's AnalysisInfo keys to make it consistent with its Analyzer (#4906)

Muneeb Ullah Khan5474feb15b33
diff --git a/pkg/detectors/anypointoauth2/anypointoauth2.go b/pkg/detectors/anypointoauth2/anypointoauth2.go
index a1f16060e..552748164 100644
--- a/pkg/detectors/anypointoauth2/anypointoauth2.go
+++ b/pkg/detectors/anypointoauth2/anypointoauth2.go
@@ -79,8 +79,8 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1.SetVerificationError(verificationErr)
if isVerified {
s1.AnalysisInfo = map[string]string{
- "id": id,
- "secret": secret,
+ "client_id": id,
+ "client_secret": secret,
}
}
}
diff --git a/pkg/detectors/coinbase/coinbase.go b/pkg/detectors/coinbase/coinbase.go
index 5ab23eca7..fc368d5dc 100644
--- a/pkg/detectors/coinbase/coinbase.go
+++ b/pkg/detectors/coinbase/coinbase.go
@@ -68,7 +68,7 @@ func isValidECPrivateKey(pemKey []byte) bool {
// Check the key type
_, ok := key.Public().(*ecdsa.PublicKey)
- return ok
+ return ok
}
func (s Scanner) getClient() *http.Client {
@@ -112,6 +112,12 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
isVerified, verificationErr := s.verifyMatch(ctx, client, resKeyName, resPrivateKey)
s1.Verified = isVerified
s1.SetVerificationError(verificationErr, resPrivateKey)
+ if isVerified {
+ s1.AnalysisInfo = map[string]string{
+ "key_name": resKeyName,
+ "key": resPrivateKey,
+ }
+ }
}
results = append(results, s1)