gitleaks: gitleaks ignores default config and doesn't merge configs
Describe the bug If I have a config like the following zero secrets are detected. I’m unable to specify a few allow directives.
[allowlist]
paths = ["testdata/malformed_key.pem"]
gitleaks reports no secrets, but there are some. This is likely due to gitleaks thinking --config should replace the default config, but that’s not what I want.
gitleaks version: 8.8.5
○
│╲
│ ○
○ ░
░ gitleaks
9:39AM INF scan completed in 4.701718ms
9:39AM INF no leaks found
finished gitleaks check
Expected behavior It would be nice to have a way to allow a few entries as many projects require dummy keys.
Basic Info (please complete the following information):
- OS: macOS 12.x
- Gitleaks Version: 8.8.5
cc @zricethezav
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 22 (10 by maintainers)
Thanks, I hear you guys. I’m thinking of ways to introduce this. In the meantime if you want this feature expedited consider reaching out to me for a maintenance and support agreement https://gitleaks.io/products.html
Some design restrictions I want to impose:
So a config might look something like
Only one
url,path, oruseDefaultshould be specified.useDefaultwould extend the repo config with the default gitleaks configcc @adamdecaf
@zricethezav awesome! We just tested this feature and it is working just as expected/hoped 🥇
Looking forward to upgrading to a new version with this feature included 😄
I have a branch I’m working on locally and still deciding on the design of this. Next month or two probably, or maybe next week. idk
@adamdecaf @very-doge-wow @foolioo @wolfch-elsevier I just merged https://github.com/zricethezav/gitleaks/pull/926. Check out the updated https://github.com/zricethezav/gitleaks#configuration section for instructions on how to use this new feature. Feel free to pull down master and try it out before I release it sometime this week with
8.9.0With the release of https://github.com/zricethezav/gitleaks/releases/tag/v8.9.0 I’m gonna close out this issue. Thanks for being patient and hope you get some value out of the new feature. Feel free to re-open or continue the discussion 👍🏻
Hi @adamdecaf, this isn’t a bug as
--configreplaces the default config by design. I am considering ways to extend the default config in the future.@very-doge-wow, nope.
includeDefaultwill use what is already baked into the binaryhttps://github.com/zricethezav/gitleaks/blob/master/config/config.go#L186-L206
https://github.com/zricethezav/gitleaks/blob/master/config/config.go#L13-L14
https://github.com/zricethezav/gitleaks/tree/extend-config wip
@wolfch-elsevier https://github.com/zricethezav/gitleaks/blob/master/config/gitleaks.toml
@zricethezav, I am echoing with @adamdecaf. It will be great if there is a separate config to allow users to customize the global allowlists without overwriting the default config.