Skip to content

Commit

Permalink
Tighten up keywords (#1874)
Browse files Browse the repository at this point in the history
  • Loading branch information
dustin-decker committed Oct 6, 2023
1 parent 77a8284 commit 22ee2c5
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 @@ -24,13 +24,13 @@ const verifyURL = "https://api.pagerduty.com/users"
var (
defaultClient = 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", "pd"}) + `\b([a-zA-Z0-9_+-]{20})\b`)
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"pagerduty", "pager_duty", "pd_", "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", "pd"}
return []string{"pagerduty", "pager_duty", "pd_", "pd-"}
}

// FromData will find and optionally verify PagerDutyApiKey secrets in a given set of bytes.
Expand Down

0 comments on commit 22ee2c5

Please sign in to comment.