Skip to content

Commit

Permalink
Fix pagerdutyapikey Detector (#1749)
Browse files Browse the repository at this point in the history
* Fix pagerdutyapikey detector by broadening regex

* Add 'pd' to list of pagerdutyapikey keywords
  • Loading branch information
harmonherring-pro authored Sep 6, 2023
1 parent d3e7c5a commit bf581ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/detectors/pagerdutyapikey/pagerdutyapikey.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit bf581ae

Please sign in to comment.