Skip to content
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

Line exclude regex just for keyword detector #131

Closed
KevinHock opened this issue Feb 12, 2019 · 7 comments
Closed

Line exclude regex just for keyword detector #131

KevinHock opened this issue Feb 12, 2019 · 7 comments
Labels
good first issue The issue can be tackled by someone who has little to no knowledge about the project. help wanted Indicates that we would like someone that’s not a maintainer to work on the issue.

Comments

@KevinHock
Copy link
Collaborator

KevinHock commented Feb 12, 2019

In #127 we added a line exclude for all plugins and reverted 15a6e6a, which was a line exclude regex for just the high-entropy plugins, this was partially due to imagined use-cases of things someone may want to exclude from all plugins e.g. lines whose first non-whitespace character is a#, and general cleanliness (DRY).

The keyword detector however, is a young plugin with kind of an ambitious goal, and users shouldn't have to add to the FALSE_POSITIVES dict things that may be specific to their codebases, and version bumps won't need to happen to trim false positives.

This is a good-first-issue, b/c it was done very similarly in 15a6e6a

@KevinHock KevinHock added enhancement help wanted Indicates that we would like someone that’s not a maintainer to work on the issue. good first issue The issue can be tackled by someone who has little to no knowledge about the project. labels Feb 12, 2019
@hpandeycodeit
Copy link
Contributor

@KevinHock I would like to work on this.

@KevinHock
Copy link
Collaborator Author

Awesome @hpandeycodeit, let me know if you need any help 👍

@hpandeycodeit
Copy link
Contributor

@KevinHock Are we looking to change the same files as in this commit 15a6e6a

@KevinHock
Copy link
Collaborator Author

KevinHock commented Feb 15, 2019

@hpandeycodeit We will still change detect_secrets/core/usage.py and tests/core/usage_test.py, except instead of changing HexHighEntropyString and Base64HighEntropyString we can change KeywordDetector to have the option. e.g. Instead of an _add_high_entropy_excludes function we can add something like a _add_keyword_exclude function that adds a --keyword-exclude option to the KeywordDetector.

Instead of the detect_secrets/plugins/high_entropy_strings.py and tests/plugins/high_entropy_strings_test.py files. We can change detect_secrets/plugins/keyword.py and tests/plugins/keyword_test.py
e.g. in keyword.py we can add an __init__ method to take in a new arg, then call super's init method. We can use the new arg to skip strings in the analyze_string_content method.

Hope this helps 👍 Let me know if you need me to clarify anything

@hpandeycodeit
Copy link
Contributor

@KevinHock Thanks for the clarification. I created a PR. Let me know what you think.

@KevinHock
Copy link
Collaborator Author

Awesome, thank you @hpandeycodeit 👍

@KevinHock
Copy link
Collaborator Author

Closing as fixed by #132

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue The issue can be tackled by someone who has little to no knowledge about the project. help wanted Indicates that we would like someone that’s not a maintainer to work on the issue.
Projects
None yet
Development

No branches or pull requests

2 participants