Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
Add AnalysisInfo to verified results (#4862)
Hona8770b879aec
diff --git a/pkg/detectors/airbrakeprojectkey/airbrakeprojectkey.go b/pkg/detectors/airbrakeprojectkey/airbrakeprojectkey.goindex 29ec88769..3971149e3 100644--- a/pkg/detectors/airbrakeprojectkey/airbrakeprojectkey.go+++ b/pkg/detectors/airbrakeprojectkey/airbrakeprojectkey.go@@ -70,6 +70,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultisVerified, verificationErr := verifyAirbrakeProjectKey(ctx, client, key, id)s1.Verified = isVerifieds1.SetVerificationError(verificationErr)+ if isVerified {+ s1.AnalysisInfo = map[string]string{"key": key}+ }}results = append(results, s1)diff --git a/pkg/detectors/airbrakeuserkey/airbrakeuserkey.go b/pkg/detectors/airbrakeuserkey/airbrakeuserkey.goindex 97515e406..80ea4e853 100644--- a/pkg/detectors/airbrakeuserkey/airbrakeuserkey.go+++ b/pkg/detectors/airbrakeuserkey/airbrakeuserkey.go@@ -61,6 +61,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultisVerified, verificationErr := verifyAirbrakeUserKey(ctx, client, key)s1.Verified = isVerifieds1.SetVerificationError(verificationErr)+ if isVerified {+ s1.AnalysisInfo = map[string]string{"key": key}+ }}results = append(results, s1)diff --git a/pkg/detectors/asanapersonalaccesstoken/asanapersonalaccesstoken.go b/pkg/detectors/asanapersonalaccesstoken/asanapersonalaccesstoken.goindex 7e3eb830d..fd29ca802 100644--- a/pkg/detectors/asanapersonalaccesstoken/asanapersonalaccesstoken.go+++ b/pkg/detectors/asanapersonalaccesstoken/asanapersonalaccesstoken.go@@ -52,6 +52,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultisVerified, err := verifyMatch(ctx, client, resMatch)s1.Verified = isVerifieds1.SetVerificationError(err, resMatch)+ if isVerified {+ s1.AnalysisInfo = map[string]string{"key": resMatch}+ }}results = append(results, s1)diff --git a/pkg/detectors/jiratoken/v1/jiratoken.go b/pkg/detectors/jiratoken/v1/jiratoken.goindex a2a8c7369..b5f6e1a23 100644--- a/pkg/detectors/jiratoken/v1/jiratoken.go+++ b/pkg/detectors/jiratoken/v1/jiratoken.go@@ -118,6 +118,13 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.SetVerificationError(verificationErr, token)}+ if isVerified {+ s1.AnalysisInfo = map[string]string{+ "token": token,+ "domain": domain,+ "email": email,+ }+ }}results = append(results, s1)diff --git a/pkg/detectors/jiratoken/v2/jiratoken_v2.go b/pkg/detectors/jiratoken/v2/jiratoken_v2.goindex cddfa9a45..965e30e8c 100644--- a/pkg/detectors/jiratoken/v2/jiratoken_v2.go+++ b/pkg/detectors/jiratoken/v2/jiratoken_v2.go@@ -90,6 +90,13 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultisVerified, verificationErr := v1.VerifyJiraToken(ctx, client, email, domain, token)s1.Verified = isVerifieds1.SetVerificationError(verificationErr, token)+ if isVerified {+ s1.AnalysisInfo = map[string]string{+ "token": token,+ "domain": domain,+ "email": email,+ }+ }}results = append(results, s1)