Skip to content

Commit

Permalink
Detector-Competition-Fix - fixed the alchemy detector regex (#1821)
Browse files Browse the repository at this point in the history
* fixed the alchemy detector

* added the chunk filtering for alcht_
  • Loading branch information
ankushgoel27 authored Apr 30, 2024
1 parent 770459e commit 7968768
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/detectors/alchemy/alchemy.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,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{"alchemy"}) + `\b([a-zA-Z0-9]{23}_[a-zA-Z0-9]{8})\b`)
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"alchemy"}) + `\b([0-9a-zA-Z_]{32}|alcht_[0-9a-zA-Z]{30})\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{"alchemy"}
return []string{"alchemy","alcht_"}
}

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

0 comments on commit 7968768

Please sign in to comment.