-
Couldn't load subscription status.
- Fork 2.1k
Add allowlist feature to suppress test secrets #4436
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @jpozucek, thanks for contributing. I'm going through your PR but I've left a couple comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work on this - the change looks pretty clean and surgical. I'd like to ask how much of a lift it would be to rename "whitelist" to "allowlist," simply because we're already using the latter term in the codebase, and we've historically found a minor but extant cognitive penalty when getting people up to speed on multiple concepts that are the same but have different names. (I'm not requesting changes for this in case it's more of a burden than I'm anticipating.)
|
@rosecodym Changed to allowlist, np! |
|
@jporzucek I tried to test |
|
@nabeelalam ahhh, rookie mistake! Please try again now |
|
Also added support for correct parsing with YAML files that don't end with a newline character. The function now automatically appends |
|
Thanks for the update @jporzucek I'll test it again in a little bit |
|
The flag is working for me now, thanks @jporzucek. This looks good! If it's not a big change, is it possible to make the flag itself a bit more accurately descriptive? |
|
@nabeelalam Renamed to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! The changes I want are using RedactGlobally instead of maskSecret and compiling the regexes up top. It's possible using slices.DeleteFunc doesn't make sense, so if it doesn't, definitely don't rework things to make it make sense.
|
@camgunz All requested changes applied! 🙌 |
|
I don't want to throw a wrench in this review, but what about introducing this feature in the |
You mean as a new field in sources? |
I was thinking a new top-level key This behavior is similar to what is offered in the gitleaks configuration https://github.com/gitleaks/gitleaks?tab=readme-ov-file#configuration. FWIW, I may be muddying the waters here but I figured since |
|
@zricethezav I've added a top-level |
|
@zricethezav @nabeelalam @camgunz Can you take a look when you got a chance? 🙏 |
Description:
Implements whitelisting #1019
Checklist:
make test-community)?make lintthis requires golangci-lint)?