From d7123c696535632fe20cf8dd4f2bac7d392d37e1 Mon Sep 17 00:00:00 2001 From: Max Thomson Date: Fri, 2 Sep 2022 11:44:16 -0700 Subject: [PATCH] Fix Honeycomb detector with both key formats (#777) --- pkg/detectors/honeycomb/honeycomb.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/detectors/honeycomb/honeycomb.go b/pkg/detectors/honeycomb/honeycomb.go index 543b29aa7ba2..74b41d8c50e4 100644 --- a/pkg/detectors/honeycomb/honeycomb.go +++ b/pkg/detectors/honeycomb/honeycomb.go @@ -20,7 +20,8 @@ var ( client = common.SaneHttpClient() // Make sure that your group is surrounded in boundary characters such as below to reduce false positives. - keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"Honeycomb"}) + `\b([0-9a-zA-Z]{22})\b`) + // Older + Newer API key format. See pull#687 for discussion + keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"Honeycomb"}) + `\b([0-9a-f]{32}|[0-9a-zA-Z]{22})\b`) ) // Keywords are used for efficiently pre-filtering chunks.