diff --git a/detect_secrets/plugins/high_entropy_strings.py b/detect_secrets/plugins/high_entropy_strings.py index c953e47f6..5c7acbb35 100644 --- a/detect_secrets/plugins/high_entropy_strings.py +++ b/detect_secrets/plugins/high_entropy_strings.py @@ -179,6 +179,8 @@ def _non_quoted_string_regex(self): class HexHighEntropyString(HighEntropyStringsPlugin): """HighEntropyStringsPlugin for hex strings""" + secret_type = 'Hex High Entropy String' + def __init__(self, limit, *args): super(HexHighEntropyString, self).__init__(string.hexdigits, limit) @@ -186,6 +188,8 @@ def __init__(self, limit, *args): class Base64HighEntropyString(HighEntropyStringsPlugin): """HighEntropyStringsPlugin for base64 encoded strings""" + secret_type = 'Base64 High Entropy String' + def __init__(self, limit, *args): super(Base64HighEntropyString, self).__init__( string.ascii_letters + string.digits + '+/=', diff --git a/tests/pre_commit_hook_test.py b/tests/pre_commit_hook_test.py index ee126d975..cc82bbe36 100644 --- a/tests/pre_commit_hook_test.py +++ b/tests/pre_commit_hook_test.py @@ -65,7 +65,7 @@ def test_file_with_secrets(self, mock_log): 'Potential secrets about to be committed to git repo!' ) assert message_by_lines[2] == \ - 'Secret Type: High Entropy String' + 'Secret Type: Base64 High Entropy String' assert message_by_lines[3] == \ 'Location: test_data/files/file_with_secrets.py:3' @@ -158,7 +158,7 @@ def _create_baseline(): 'results': { 'test_data/files/file_with_secrets.py': [ { - 'type': 'High Entropy String', + 'type': 'Base64 High Entropy String', 'line_number': 3, 'hashed_secret': PotentialSecret.hash_secret(base64_secret), },