From 4cd055fe3f13b5e17fcb19553c623f1f2720e9f3 Mon Sep 17 00:00:00 2001 From: Bill Rich Date: Wed, 4 Dec 2024 17:49:39 -0800 Subject: [PATCH] Add analysis info for GCP creds (#3727) * Add user info for gcp credential * Use principal and include Type --- pkg/detectors/gcp/gcp.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/detectors/gcp/gcp.go b/pkg/detectors/gcp/gcp.go index f8b19edab2c9..5785974f5bd6 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 {