Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
Ignore URIs where the password is redacted (#842)
Dustin Decker785cead43ee6
diff --git a/pkg/detectors/uri/uri.go b/pkg/detectors/uri/uri.goindex 18e8ab1ed..b68e32f2f 100644--- a/pkg/detectors/uri/uri.go+++ b/pkg/detectors/uri/uri.go@@ -76,6 +76,11 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultcontinue}+ // Skip findings where the password only has "*" characters, this is a redacted password+ if strings.Trim(password, "*") == "" {+ continue+ }+parsedURL, err := url.Parse(urlMatch)if err != nil {continuediff --git a/pkg/sources/filesystem/filesystem.go b/pkg/sources/filesystem/filesystem.goindex e0863b706..c92ece40e 100644--- a/pkg/sources/filesystem/filesystem.go+++ b/pkg/sources/filesystem/filesystem.go@@ -111,6 +111,7 @@ func (s *Source) Chunks(ctx context.Context, chunksChan chan *sources.Chunk) errreturn nil}defer inputFile.Close()+ log.WithField("file_path", path).Trace("scanning file")reReader, err := diskbufferreader.New(inputFile)if err != nil {