-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable use of .gitignore for exclusions in filesystem scans #3356
Comments
Typically the files you don't want to commit are the most likely to contain credentials — but I agree it would be useful. |
Exactly. It's safe to exclude a |
Ah, but what if that wasn't always the case? What if it was only added to the .gitignore after someone accidentally pushed theirs? This is a frequent mistake and source of leaks in my experience. |
I don't think they should be using a filesystem scan if their concern is finding things that have already been pushed to a remote repository. I see the filesystem scan serving the purpose of preventing future leaks, whereas a git scan can help find and remediate past leaks. |
Please review the Community Note before submitting
Description
The flag for
--exclude-paths
expects a file with line separated regexes to be provided. Most projects will have a.gitignore
file with line separated glob patterns that would likely be the set of files you'd want excluded from a TruffleHog scan. It seems natural to accept a file with glob patterns as an exclusion list.Preferred Solution
A new flag
--exclude-paths-glob
that takes in a file with new line separated glob patterns. These glob patterns can be read in, translated to regex using the glob package and included in the exclude Filter rules alongside any regexes coming from--exclude-paths
.Additional Context
N/A
References
N/A
The text was updated successfully, but these errors were encountered: