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

Reduce sequential string false positives #64

Merged
merged 2 commits into from
Jul 31, 2018

Conversation

KevinHock
Copy link
Collaborator

No description provided.

@KevinHock KevinHock requested a review from domanchi July 31, 2018 00:44
Copy link
Contributor

@domanchi domanchi left a comment

Choose a reason for hiding this comment

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

fix'n'ship!

@@ -17,6 +17,12 @@
from detect_secrets.plugins.core.yaml_file_parser import YamlFileParser


IGNORED_SEQUENTIAL_STRINGS = (
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use the string library for this.

e.g.

import string

IGNORED_SEQUENTIAL_STRINGS = (
    string.ascii_uppercase + string.digits + string.ascii_uppercase,
    string.hexdigits + string.hexdigits,
)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

++
Changed it to

 IGNORED_SEQUENTIAL_STRINGS = (
-    'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/',  # upper/lower, numbers +/
-    '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ+/',  # numbers, upper/lower +/
-    'ABCDEFABCDEF0123456789ABCDEFABCDEF',  # Hex
-    'ABCDEFGHIJKLMNOPQRSTUVWXYZ=/',
+    (
+        string.ascii_uppercase +
+        string.ascii_uppercase +
+        string.digits +
+        string.ascii_uppercase +
+        string.ascii_uppercase +
+        '+/'
+    ),
+    string.hexdigits.upper() + string.hexdigits.upper(),
+    string.ascii_uppercase + '=/',
 )

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'm trying to use rebasing to make my commit history super clean, like someone I know. (@bcaller)

@KevinHock KevinHock force-pushed the 62_reduce_sequential_false_positives branch from 15f3523 to b5135fc Compare July 31, 2018 01:19
@KevinHock KevinHock merged commit 8c2d022 into master Jul 31, 2018
@KevinHock KevinHock deleted the 62_reduce_sequential_false_positives branch July 31, 2018 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants