Fix pagerdutyapikey Detector (#1749)

* Fix pagerdutyapikey detector by broadening regex

* Add 'pd' to list of pagerdutyapikey keywords
This commit is contained in:
Harmon Herring 2023-09-06 12:15:39 -04:00 committed by GitHub
parent d3e7c5acc2
commit bf581ae9f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,13 +21,13 @@ 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{"pagerduty"}) + `\b([a-z]{1}\+[a-zA-Z]{9}\-[a-z]{2}\-[a-z0-9]{5})\b`)
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"pagerduty", "pd"}) + `\b([a-zA-Z0-9_+-]{20})\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{"pagerduty"}
return []string{"pagerduty", "pd"}
}
// FromData will find and optionally verify PagerDutyApiKey secrets in a given set of bytes.