Skip to content

Find, verify, and analyze leaked credentials

Ignore URIs where the password is redacted (#842)

Dustin Decker785cead43ee6
diff --git a/pkg/detectors/uri/uri.go b/pkg/detectors/uri/uri.go
index 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) (result
continue
}
+ // 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 {
continue
diff --git a/pkg/sources/filesystem/filesystem.go b/pkg/sources/filesystem/filesystem.go
index 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) err
return nil
}
defer inputFile.Close()
+ log.WithField("file_path", path).Trace("scanning file")
reReader, err := diskbufferreader.New(inputFile)
if err != nil {