Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
Use defautl endpoints when no custom verifier provided. (#1242)
ahravf107e1b49792
diff --git a/pkg/detectors/github/github.go b/pkg/detectors/github/github.goindex 7b08ab085..cda1c7098 100644--- a/pkg/detectors/github/github.go+++ b/pkg/detectors/github/github.go@@ -82,6 +82,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultmatches := keyPat.FindAllStringSubmatch(dataStr, -1)+ if len(s.verifierURLs) == 0 {+ s.verifierURLs = append(s.verifierURLs, defaultURL)+ }+for _, match := range matches {// First match is entire regex, second is the first group.if len(match) != 2 {diff --git a/pkg/detectors/gitlab/gitlab.go b/pkg/detectors/gitlab/gitlab.goindex bc7990d7a..6fe1d11ed 100644--- a/pkg/detectors/gitlab/gitlab.go+++ b/pkg/detectors/gitlab/gitlab.go@@ -63,6 +63,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultmatches := keyPat.FindAllStringSubmatch(dataStr, -1)+ if len(s.verifierURLs) == 0 {+ s.verifierURLs = append(s.verifierURLs, defaultURL)+ }+for _, match := range matches {if len(match) != 2 {continuediff --git a/pkg/detectors/gitlabv2/gitlab.go b/pkg/detectors/gitlabv2/gitlab.goindex ffc0b7bf8..41f62c419 100644--- a/pkg/detectors/gitlabv2/gitlab.go+++ b/pkg/detectors/gitlabv2/gitlab.go@@ -62,6 +62,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultmatches := keyPat.FindAllStringSubmatch(dataStr, -1)+ if len(s.verifierURLs) == 0 {+ s.verifierURLs = append(s.verifierURLs, defaultURL)+ }+for _, match := range matches {if len(match) != 2 {continue