Skip to content

Commit

Permalink
iterating on suggestions (#1742)
Browse files Browse the repository at this point in the history
  • Loading branch information
shivasurya authored Sep 1, 2023
1 parent 2e4b17d commit 0a949d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/detectors/sourcegraph/sourcegraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ var _ detectors.Detector = (*Scanner)(nil)
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{"sourcegraph", "sg_token"}) + `\b(sgp_[a-z0-9]{40})\b`)
keyPat = regexp.MustCompile(`\b(sgp_[a-f0-9]{40})\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{"sourcegraph", "sg_token"}
return []string{"sgp_"}
}

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

0 comments on commit 0a949d7

Please sign in to comment.