From b232ec8b4e506bdc69df4a38d32f520dbf62034c Mon Sep 17 00:00:00 2001 From: Dylan Ayrey Date: Mon, 2 Oct 2023 06:49:40 -0700 Subject: [PATCH] fixing razorpay (#1852) Co-authored-by: counter --- pkg/detectors/razorpay/razorpay.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/detectors/razorpay/razorpay.go b/pkg/detectors/razorpay/razorpay.go index 5385019909f3..4071ddc73c48 100644 --- a/pkg/detectors/razorpay/razorpay.go +++ b/pkg/detectors/razorpay/razorpay.go @@ -21,14 +21,14 @@ var _ detectors.Detector = (*Scanner)(nil) var ( client = common.SaneHttpClient() - keyPat = regexp.MustCompile(`(?i)\brzp_live_\w{10,20}\b`) - secretPat = regexp.MustCompile(detectors.PrefixRegex([]string{"razor|secret|rzp|key"}) + `([A-Za-z0-9]{20,50})`) + keyPat = regexp.MustCompile(`(?i)\brzp_live_[A-Za-z0-9]{14}\b`) + secretPat = regexp.MustCompile(`\b[A-Za-z0-9]{24}\b`) ) // Keywords are used for efficiently pre-filtering chunks. // Use identifiers in the secret preferably, or the provider name. func (s Scanner) Keywords() []string { - return []string{"rzp_"} + return []string{"rzp_live_"} } // FromData will find and optionally verify RazorPay secrets in a given set of bytes.