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

[Keyword Plugin] Add more to FALSE_POSITIVES #118

Merged
merged 1 commit into from
Jan 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions detect_secrets/plugins/keyword.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,29 @@
'dummy_secret',
'false',
'false):',
'false,',
'false;',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some point, I wonder whether it would be better to just do:

FALSE_POSITIVES = []
for key in ['false', 'none', ...]:
    for suffix in [',', ';', '']:
        FALSE_POSITIVES.append(key + suffix)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I think we will at some point, a lot fp's don't have a trailing char so I'm gonna hold off until it is more battle-tested.

Also been meaning to make it a dict instead of a tuple.

'none',
'none,',
'none}',
'not',
'null',
'null,',
'null;',
'password',
'password)',
'password,',
'password},',
'some_key',
'string,',
'string}',
'string}}',
'test-access-key',
'todo',
'true',
'true):',
'true,',
'true;',
'{',
)
FOLLOWED_BY_COLON_RE = re.compile(
Expand Down