Skip to content

Find, verify, and analyze leaked credentials

Add analysis info for GCP creds (#3727)

Bill Rich4cd055fe3f13
diff --git a/pkg/detectors/gcp/gcp.go b/pkg/detectors/gcp/gcp.go
index f8b19edab..5785974f5 100644
--- a/pkg/detectors/gcp/gcp.go
+++ b/pkg/detectors/gcp/gcp.go
@@ -113,6 +113,13 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
"rotation_guide": "https://howtorotate.com/docs/tutorials/gcp/",
"project": creds.ProjectID,
},
+ AnalysisInfo: map[string]string{
+ "principal": creds.ClientEmail,
+ },
+ }
+
+ if creds.Type != "" {
+ result.AnalysisInfo["type"] = creds.Type
}
if verify {