Skip to content

Find, verify, and analyze leaked credentials

add extradata nil check and use make (#2129)

Zachary Riced55222238581
diff --git a/pkg/detectors/awssessionkeys/awssessionkey.go b/pkg/detectors/awssessionkeys/awssessionkey.go
index 3b53aa27f..aee31402b 100644
--- a/pkg/detectors/awssessionkeys/awssessionkey.go
+++ b/pkg/detectors/awssessionkeys/awssessionkey.go
@@ -130,13 +130,15 @@ func (s scanner) FromData(ctx context.Context, verify bool, data []byte) (result
Raw: []byte(resIDMatch),
Redacted: resIDMatch,
RawV2: []byte(resIDMatch + resSecretMatch + resSessionMatch),
- ExtraData: map[string]string{},
+ ExtraData: make(map[string]string),
}
if verify {
verified, extraData, verificationErr := s.verifyMatch(ctx, resIDMatch, resSecretMatch, resSessionMatch, true)
s1.Verified = verified
- s1.ExtraData = extraData
+ if extraData != nil {
+ s1.ExtraData = extraData
+ }
s1.VerificationError = verificationErr
}