Skip to content

Find, verify, and analyze leaked credentials

Fix filesystem enumeration ignore paths bug (#2355)

Miccah6824eb41ea6a
diff --git a/pkg/sources/filesystem/filesystem.go b/pkg/sources/filesystem/filesystem.go
index 9a1c4ceb9..ca4edd947 100644
--- a/pkg/sources/filesystem/filesystem.go
+++ b/pkg/sources/filesystem/filesystem.go
@@ -240,6 +240,9 @@ func (s *Source) Enumerate(ctx context.Context, reporter sources.UnitReporter) e
return nil
}
fullPath := filepath.Join(path, relativePath)
+ if s.filter != nil && !s.filter.Pass(fullPath) {
+ return nil
+ }
item := sources.CommonSourceUnit{ID: fullPath}
return reporter.UnitOk(ctx, item)
})