This repository has been archived by the owner on Jul 12, 2022. It is now read-only.
forked from Yelp/detect-secrets
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:Yelp/detect-secrets into verifiab…
…le-secrets
- Loading branch information
Showing
24 changed files
with
266 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
""" | ||
Heuristic, false positive filters that are shared across all plugin types. | ||
This abstraction allows for development of later ML work, or further | ||
heuristical determinations (e.g. word filter, entropy comparator). | ||
""" | ||
import string | ||
|
||
|
||
def is_false_positive(secret): | ||
for func in [ | ||
is_sequential_string, | ||
]: | ||
if func(secret): | ||
return True | ||
|
||
return False | ||
|
||
|
||
def is_sequential_string(secret): | ||
""" | ||
Returns true if string is sequential. | ||
""" | ||
sequences = ( | ||
( | ||
string.ascii_uppercase + | ||
string.ascii_uppercase + | ||
string.digits + | ||
string.ascii_uppercase + | ||
string.ascii_uppercase + | ||
'+/' | ||
), | ||
|
||
# Capturing any number sequences | ||
'0123456789' * 2, | ||
|
||
string.hexdigits.upper() + string.hexdigits.upper(), | ||
string.ascii_uppercase + '=/', | ||
) | ||
|
||
uppercase = secret.upper() | ||
for sequential_string in sequences: | ||
if uppercase in sequential_string: | ||
return True | ||
|
||
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
long_description=( | ||
'Check out detect-secrets on `GitHub <https://github.com/Yelp/detect-secrets>`_!' | ||
), | ||
license="Copyright Yelp, Inc. 2018", | ||
license='Copyright Yelp, Inc. 2018', | ||
author='Aaron Loo', | ||
author_email='[email protected]', | ||
url='https://github.com/Yelp/detect-secrets', | ||
|
@@ -37,14 +37,14 @@ | |
], | ||
}, | ||
classifiers=[ | ||
"Programming Language :: Python :: 2", | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Intended Audience :: Developers", | ||
"Topic :: Software Development", | ||
"Topic :: Utilities", | ||
"Environment :: Console", | ||
"Operating System :: OS Independent", | ||
"Development Status :: 5 - Production/Stable", | ||
'Programming Language :: Python :: 2', | ||
'Programming Language :: Python :: 3', | ||
'License :: OSI Approved :: Apache Software License', | ||
'Intended Audience :: Developers', | ||
'Topic :: Software Development', | ||
'Topic :: Utilities', | ||
'Environment :: Console', | ||
'Operating System :: OS Independent', | ||
'Development Status :: 5 - Production/Stable', | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.