From 4938d67e66e671faeb6be42d89da6c732bc89bba Mon Sep 17 00:00:00 2001 From: Zachary Rice Date: Tue, 20 Jun 2023 13:55:31 -0500 Subject: [PATCH] Custom detector name (#1400) * hacky way to add detector name to output * set name in custom detectors --- pkg/custom_detectors/custom_detectors.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/custom_detectors/custom_detectors.go b/pkg/custom_detectors/custom_detectors.go index 09b7e928c675..c6980a2ec708 100644 --- a/pkg/custom_detectors/custom_detectors.go +++ b/pkg/custom_detectors/custom_detectors.go @@ -99,6 +99,10 @@ func (c *customRegexWebhook) FromData(ctx context.Context, verify bool, data []b close(resultsCh) for result := range resultsCh { + // NOTE: I don't believe this is being set anywhere else, hence the map assignment. + result.ExtraData = map[string]string{ + "name": c.GetName(), + } results = append(results, result) }