diff --git a/credsweeper/common/keyword_pattern.py b/credsweeper/common/keyword_pattern.py index dd63293cc..db26d51b5 100644 --- a/credsweeper/common/keyword_pattern.py +++ b/credsweeper/common/keyword_pattern.py @@ -4,7 +4,7 @@ class KeywordPattern: """Pattern set of keyword types""" key_left = r"(\\[nrt])?"\ - r"(?P(([`'\"]+[^:='\"`}<>\\/&?]*|[^:='\"`}<>\s()\\/&?]*)" \ + r"(?P(([`'\"]+[^:='\"`}<>\\/&?]*|[^:='\"`}<>\s()\\/&?;,]*)" \ r"(?P" # there will be inserted a keyword key_right = r")" \ diff --git a/credsweeper/filters/__init__.py b/credsweeper/filters/__init__.py index 8f72c7c11..0ff1da4b8 100644 --- a/credsweeper/filters/__init__.py +++ b/credsweeper/filters/__init__.py @@ -2,6 +2,7 @@ from credsweeper.filters.line_git_binary_check import LineGitBinaryCheck from credsweeper.filters.line_specific_key_check import LineSpecificKeyCheck +from credsweeper.filters.line_uue_part_check import LineUUEPartCheck from credsweeper.filters.value_allowlist_check import ValueAllowlistCheck from credsweeper.filters.value_array_dictionary_check import ValueArrayDictionaryCheck from credsweeper.filters.value_atlassian_token_check import ValueAtlassianTokenCheck diff --git a/credsweeper/filters/group/password_keyword.py b/credsweeper/filters/group/password_keyword.py index 4e558cb69..e50acb6e7 100644 --- a/credsweeper/filters/group/password_keyword.py +++ b/credsweeper/filters/group/password_keyword.py @@ -3,6 +3,7 @@ from credsweeper.filters import ValueDictionaryValueLengthCheck, LineGitBinaryCheck from credsweeper.filters import ValueSplitKeywordCheck from credsweeper.filters.group import Group +from credsweeper.filters.line_uue_part_check import LineUUEPartCheck class PasswordKeyword(Group): @@ -10,4 +11,8 @@ class PasswordKeyword(Group): def __init__(self, config: Config) -> None: super().__init__(config, GroupType.KEYWORD) - self.filters.extend([ValueDictionaryValueLengthCheck(), ValueSplitKeywordCheck(), LineGitBinaryCheck()]) + self.filters.extend( + [ValueDictionaryValueLengthCheck(), + ValueSplitKeywordCheck(), + LineGitBinaryCheck(), + LineUUEPartCheck()]) diff --git a/credsweeper/filters/line_git_binary_check.py b/credsweeper/filters/line_git_binary_check.py index fabfd36a8..5b02f89f7 100644 --- a/credsweeper/filters/line_git_binary_check.py +++ b/credsweeper/filters/line_git_binary_check.py @@ -26,7 +26,7 @@ def run(self, line_data: LineData, target: AnalysisTarget) -> bool: True, if need to filter candidate and False if left """ - if line_data.line is None: + if not line_data.line: return True if 66 < target.line_strip_len: return False diff --git a/credsweeper/filters/line_uue_part_check.py b/credsweeper/filters/line_uue_part_check.py new file mode 100644 index 000000000..089a735f2 --- /dev/null +++ b/credsweeper/filters/line_uue_part_check.py @@ -0,0 +1,44 @@ +import re + +from credsweeper.config import Config +from credsweeper.credentials import LineData +from credsweeper.file_handler.analysis_target import AnalysisTarget +from credsweeper.filters import Filter + + +class LineUUEPartCheck(Filter): + """Checks that line is not a part of UU encoding only for maximal line""" + uue_string = re.compile(r"^M[!-`]{60}$") + + def __init__(self, config: Config = None) -> None: + pass + + def run(self, line_data: LineData, target: AnalysisTarget) -> bool: + """Run filter checks on received credential candidate data 'line_data'. + + Args: + line_data: credential candidate data + target: multiline target from which line data was obtained + + Return: + True, if need to filter candidate and False if left + + """ + if not line_data.line: + return True + if 61 != target.line_len: + return False + line = target.line + if LineUUEPartCheck.uue_string.match(line): + # to be sure - check two lines: before and/or after + if 0 < line_data.line_pos: + previous_line = target.lines[line_data.line_pos - 1] + if LineUUEPartCheck.uue_string.match(previous_line): + return True + + if len(target.lines) > 1 + line_data.line_pos: + next_line = target.lines[line_data.line_pos + 1] + if LineUUEPartCheck.uue_string.match(next_line): + return True + + return False diff --git a/credsweeper/rules/config.yaml b/credsweeper/rules/config.yaml index dbcfe72e8..2750975dd 100644 --- a/credsweeper/rules/config.yaml +++ b/credsweeper/rules/config.yaml @@ -14,9 +14,6 @@ - token - secret - key - - ":" - - "/" - - "=" - 키 - 암호 - 암호화 @@ -35,15 +32,16 @@ - ValuePatternCheck - ValueDictionaryKeywordCheck - LineGitBinaryCheck + - LineUUEPartCheck - ValueFilePathCheck - ValueHexNumberCheck min_line_len: 10 required_substrings: - pass - sword - - ":" - - "/" - - "=" + - pw + - p/w + - paasw - 비밀번호 - 비번 - 패스워드 diff --git a/tests/__init__.py b/tests/__init__.py index 575514bac..52751b5ee 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -7,11 +7,11 @@ NEGLIGIBLE_ML_THRESHOLD = 0.0001 # credentials count after scan -SAMPLES_CRED_COUNT: int = 396 -SAMPLES_CRED_LINE_COUNT: int = 414 +SAMPLES_CRED_COUNT: int = 397 +SAMPLES_CRED_LINE_COUNT: int = 415 # credentials count after post-processing -SAMPLES_POST_CRED_COUNT: int = 349 +SAMPLES_POST_CRED_COUNT: int = 354 # with option --doc SAMPLES_IN_DOC = 430 diff --git a/tests/data/depth_3.json b/tests/data/depth_3.json index 14bd8ae9f..a6c09d537 100644 --- a/tests/data/depth_3.json +++ b/tests/data/depth_3.json @@ -1714,7 +1714,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.95, + "ml_probability": 0.963, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -1727,8 +1727,8 @@ "value": "dipPr14Gg!", "value_start": 19, "value_end": 29, - "variable": "master,password", - "variable_start": 3, + "variable": "password", + "variable_start": 10, "variable_end": 18, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -1822,7 +1822,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.956, + "ml_probability": 0.967, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -1835,8 +1835,8 @@ "value": "dipPr19Gg!", "value_start": 25, "value_end": 35, - "variable": "master,password", - "variable_start": 9, + "variable": "password", + "variable_start": 16, "variable_end": 24, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -1849,7 +1849,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.934, + "ml_probability": 0.962, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -1862,8 +1862,8 @@ "value": "dipPr111Gg!", "value_start": 22, "value_end": 33, - "variable": "master,password", - "variable_start": 6, + "variable": "password", + "variable_start": 13, "variable_end": 21, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -1903,7 +1903,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.972, + "ml_probability": 0.98, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -1916,8 +1916,8 @@ "value": "dipPr114Gg!", "value_start": 21, "value_end": 32, - "variable": "master,password", - "variable_start": 5, + "variable": "password", + "variable_start": 12, "variable_end": 20, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -1930,7 +1930,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.988, + "ml_probability": 0.992, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -1943,8 +1943,8 @@ "value": "dipPr115Gg!", "value_start": 21, "value_end": 32, - "variable": "master,password", - "variable_start": 5, + "variable": "password", + "variable_start": 12, "variable_end": 20, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2011,7 +2011,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.96, + "ml_probability": 0.972, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2024,8 +2024,8 @@ "value": "dipPr118Gg!", "value_start": 25, "value_end": 36, - "variable": "master,password", - "variable_start": 9, + "variable": "password", + "variable_start": 16, "variable_end": 24, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2173,7 +2173,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.963, + "ml_probability": 0.972, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2186,8 +2186,8 @@ "value": "dipPr126Gg!", "value_start": 23, "value_end": 34, - "variable": "master,password", - "variable_start": 7, + "variable": "password", + "variable_start": 14, "variable_end": 22, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2254,7 +2254,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.866, + "ml_probability": 0.908, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2267,8 +2267,8 @@ "value": "dipPr129Gg!", "value_start": 16, "value_end": 27, - "variable": "master,pw", - "variable_start": 6, + "variable": "pw", + "variable_start": 13, "variable_end": 15, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2470,7 +2470,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.991, + "ml_probability": 0.993, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2483,8 +2483,8 @@ "value": "dipPr138Gg!", "value_start": 28, "value_end": 39, - "variable": "master,ANYpassword", - "variable_start": 9, + "variable": "ANYpassword", + "variable_start": 16, "variable_end": 27, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2605,7 +2605,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.859, + "ml_probability": 0.942, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2618,8 +2618,8 @@ "value": "dipPr144Gg!", "value_start": 17, "value_end": 28, - "variable": "master,pass", - "variable_start": 5, + "variable": "pass", + "variable_start": 12, "variable_end": 16, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2686,7 +2686,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.896, + "ml_probability": 0.958, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2699,8 +2699,8 @@ "value": "dipPr147Gg!", "value_start": 15, "value_end": 26, - "variable": "master,pass", - "variable_start": 3, + "variable": "pass", + "variable_start": 10, "variable_end": 14, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2929,7 +2929,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.8, + "ml_probability": 0.854, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2942,8 +2942,8 @@ "value": "dipPr158Gg!", "value_start": 16, "value_end": 27, - "variable": "master,pwd", - "variable_start": 5, + "variable": "pwd", + "variable_start": 12, "variable_end": 15, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2956,7 +2956,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.991, + "ml_probability": 0.993, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2969,8 +2969,8 @@ "value": "dipPr159Gg!", "value_start": 33, "value_end": 44, - "variable": "master,ANY_password", - "variable_start": 13, + "variable": "ANY_password", + "variable_start": 20, "variable_end": 32, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2983,7 +2983,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.984, + "ml_probability": 0.987, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2996,8 +2996,8 @@ "value": "dipPr160Gg!", "value_start": 32, "value_end": 43, - "variable": "master,ANY_password", - "variable_start": 12, + "variable": "ANY_password", + "variable_start": 19, "variable_end": 31, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -3172,7 +3172,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.855, + "ml_probability": 0.794, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -3185,8 +3185,8 @@ "value": "dipPr169Gg!", "value_start": 15, "value_end": 26, - "variable": "master,PW", - "variable_start": 5, + "variable": "PW", + "variable_start": 12, "variable_end": 14, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -3280,7 +3280,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.984, + "ml_probability": 0.988, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -3293,8 +3293,8 @@ "value": "dipPr176Gg!", "value_start": 21, "value_end": 32, - "variable": "master,password", - "variable_start": 5, + "variable": "password", + "variable_start": 12, "variable_end": 20, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -3307,7 +3307,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.945, + "ml_probability": 0.919, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -3320,8 +3320,8 @@ "value": "dipPr177Gg!", "value_start": 20, "value_end": 31, - "variable": "master,PW", - "variable_start": 10, + "variable": "PW", + "variable_start": 17, "variable_end": 19, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -3361,7 +3361,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.99, + "ml_probability": 0.992, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -3374,8 +3374,8 @@ "value": "dipPr179Gg!", "value_start": 21, "value_end": 32, - "variable": "master,password", - "variable_start": 5, + "variable": "password", + "variable_start": 12, "variable_end": 20, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -3469,7 +3469,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.737, + "ml_probability": 0.804, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -3482,8 +3482,8 @@ "value": "dipPr186Gg!", "value_start": 16, "value_end": 27, - "variable": "master,pwd", - "variable_start": 5, + "variable": "pwd", + "variable_start": 12, "variable_end": 15, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -3601,6 +3601,60 @@ } ] }, + { + "api_validation": "NOT_AVAILABLE", + "ml_validation": "VALIDATED_KEY", + "ml_probability": 0.841, + "rule": "Password", + "severity": "medium", + "confidence": "moderate", + "line_data_list": [ + { + "line": "id:master@example.com,pw:dipPr198Gg!", + "line_num": 99, + "path": "./tests/samples/doc_id_pair_passwd_pair", + "info": "./tests/samples/doc_id_pair_passwd_pair|RAW", + "value": "dipPr198Gg!", + "value_start": 25, + "value_end": 36, + "variable": "pw", + "variable_start": 22, + "variable_end": 24, + "entropy_validation": { + "iterator": "BASE64_CHARS", + "entropy": 3.1449378351248165, + "valid": false + } + } + ] + }, + { + "api_validation": "NOT_AVAILABLE", + "ml_validation": "VALIDATED_KEY", + "ml_probability": 0.747, + "rule": "Password", + "severity": "medium", + "confidence": "moderate", + "line_data_list": [ + { + "line": "id:master@example.com,pw:IHQSB1GG!", + "line_num": 102, + "path": "./tests/samples/doc_id_pair_passwd_pair", + "info": "./tests/samples/doc_id_pair_passwd_pair|RAW", + "value": "IHQSB1GG!", + "value_start": 25, + "value_end": 34, + "variable": "pw", + "variable_start": 22, + "variable_end": 24, + "entropy_validation": { + "iterator": "BASE64_CHARS", + "entropy": 2.595488890170944, + "valid": false + } + } + ] + }, { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", @@ -5599,6 +5653,33 @@ } ] }, + { + "api_validation": "NOT_AVAILABLE", + "ml_validation": "VALIDATED_KEY", + "ml_probability": 0.997, + "rule": "Password", + "severity": "medium", + "confidence": "moderate", + "line_data_list": [ + { + "line": "gildong.hong@98.76.54.32,pw:IhqSb1Gg", + "line_num": 47, + "path": "./tests/samples/doc_various", + "info": "./tests/samples/doc_various|RAW", + "value": "IhqSb1Gg", + "value_start": 28, + "value_end": 36, + "variable": "pw", + "variable_start": 25, + "variable_end": 27, + "entropy_validation": { + "iterator": "BASE64_CHARS", + "entropy": 3.0, + "valid": false + } + } + ] + }, { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", @@ -5896,6 +5977,33 @@ } ] }, + { + "api_validation": "NOT_AVAILABLE", + "ml_validation": "VALIDATED_KEY", + "ml_probability": 0.996, + "rule": "Password", + "severity": "medium", + "confidence": "moderate", + "line_data_list": [ + { + "line": "master@98.76.54.32,PW:IhqSb1Gg", + "line_num": 74, + "path": "./tests/samples/doc_various", + "info": "./tests/samples/doc_various|RAW", + "value": "IhqSb1Gg", + "value_start": 22, + "value_end": 30, + "variable": "PW", + "variable_start": 19, + "variable_end": 21, + "entropy_validation": { + "iterator": "BASE64_CHARS", + "entropy": 3.0, + "valid": false + } + } + ] + }, { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", @@ -5939,8 +6047,8 @@ "value": "IhqSb1Gg", "value_start": 15, "value_end": 23, - "variable": "xxxx,PW", - "variable_start": 7, + "variable": "PW", + "variable_start": 12, "variable_end": 14, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -8664,6 +8772,33 @@ } ] }, + { + "api_validation": "NOT_AVAILABLE", + "ml_validation": "VALIDATED_KEY", + "ml_probability": 0.999, + "rule": "Password", + "severity": "medium", + "confidence": "moderate", + "line_data_list": [ + { + "line": "MYSQL_DATABASE_USER=CRED;MYSQL_DATABASE_PASSWORD=2IWJD88FH4Y;", + "line_num": 12, + "path": "./tests/samples/password_TRUE", + "info": "./tests/samples/password_TRUE|RAW", + "value": "2IWJD88FH4Y", + "value_start": 49, + "value_end": 60, + "variable": "MYSQL_DATABASE_PASSWORD", + "variable_start": 25, + "variable_end": 48, + "entropy_validation": { + "iterator": "BASE64_CHARS", + "entropy": 3.277613436819116, + "valid": false + } + } + ] + }, { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", diff --git a/tests/data/ml_threshold.json b/tests/data/ml_threshold.json index 538d3716f..e0645e36f 100644 --- a/tests/data/ml_threshold.json +++ b/tests/data/ml_threshold.json @@ -1538,7 +1538,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.533, + "ml_probability": 0.42, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -1551,8 +1551,8 @@ "value": "56828473c3d769ef2315ebdd2ce0be7d08faf3c28bd93a63ab95247c3d981e08", "value_start": 13, "value_end": 23, - "variable": "b48f052814bbd605932530ddfcfdc16211ecd4dab7324ac253587d7836698621", - "variable_start": 3, + "variable": "bc8478052e3ca9de6522b003c9297f7a5319cc5e8477991b48a2402c8c5ced61", + "variable_start": 10, "variable_end": 12, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -1646,7 +1646,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.95, + "ml_probability": 0.963, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -1659,8 +1659,8 @@ "value": "5f7ae79d7eb14507b6234de990a4dfc3a592c5b4f49dcfa28a4a5890ae2ec6aa", "value_start": 19, "value_end": 29, - "variable": "b107737795e97289a71daa46f9c2f2370ddf3fc2435189a5c2126dc9e6b6a85b", - "variable_start": 3, + "variable": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8", + "variable_start": 10, "variable_end": 18, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -1754,7 +1754,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.956, + "ml_probability": 0.967, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -1767,8 +1767,8 @@ "value": "838c2bb8eb6f7e54f661069d55f8b31c2e4b320c19eccad748c74bdfa2b681f7", "value_start": 25, "value_end": 35, - "variable": "b107737795e97289a71daa46f9c2f2370ddf3fc2435189a5c2126dc9e6b6a85b", - "variable_start": 9, + "variable": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8", + "variable_start": 16, "variable_end": 24, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -1808,7 +1808,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.934, + "ml_probability": 0.962, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -1821,8 +1821,8 @@ "value": "3189180894a873b050c37ccf20ac43db12df88a5a79cdc53c8abfbe54c364b8b", "value_start": 22, "value_end": 33, - "variable": "b107737795e97289a71daa46f9c2f2370ddf3fc2435189a5c2126dc9e6b6a85b", - "variable_start": 6, + "variable": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8", + "variable_start": 13, "variable_end": 21, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -1889,7 +1889,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.972, + "ml_probability": 0.98, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -1902,8 +1902,8 @@ "value": "915e305afb0a698028349efba9092199409bcea6458fc0973f9ef5d7775e393f", "value_start": 21, "value_end": 32, - "variable": "b107737795e97289a71daa46f9c2f2370ddf3fc2435189a5c2126dc9e6b6a85b", - "variable_start": 5, + "variable": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8", + "variable_start": 12, "variable_end": 20, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -1916,7 +1916,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.988, + "ml_probability": 0.992, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -1929,8 +1929,8 @@ "value": "e54bbe039c085577f42813a7854c5eacae2e7fd86b99e1cf9f66584213883742", "value_start": 21, "value_end": 32, - "variable": "b107737795e97289a71daa46f9c2f2370ddf3fc2435189a5c2126dc9e6b6a85b", - "variable_start": 5, + "variable": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8", + "variable_start": 12, "variable_end": 20, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -1997,7 +1997,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.96, + "ml_probability": 0.972, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2010,8 +2010,8 @@ "value": "cefd8fa13dce750fa9491815e45432b9411768770762857cc07c79b88581312c", "value_start": 25, "value_end": 36, - "variable": "b107737795e97289a71daa46f9c2f2370ddf3fc2435189a5c2126dc9e6b6a85b", - "variable_start": 9, + "variable": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8", + "variable_start": 16, "variable_end": 24, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2186,7 +2186,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.963, + "ml_probability": 0.972, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2199,8 +2199,8 @@ "value": "aad48bd7acb32f958ae4ecb1929acbed2e4827c2e4ab518c2f9bfcfb279a678d", "value_start": 23, "value_end": 34, - "variable": "b107737795e97289a71daa46f9c2f2370ddf3fc2435189a5c2126dc9e6b6a85b", - "variable_start": 7, + "variable": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8", + "variable_start": 14, "variable_end": 22, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2267,7 +2267,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.866, + "ml_probability": 0.908, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2280,8 +2280,8 @@ "value": "c2651d966e18291567859b92a49565d097f4b5c9ff69f0c12563c08abc01af54", "value_start": 16, "value_end": 27, - "variable": "cc26f810bfce5764b5cbd1b6d043a18210fe93ef421c5de27cdbfb1646248fe4", - "variable_start": 6, + "variable": "30c952fab122c3f9759f02a6d95c3758b246b4fee239957b2d4fee46e26170c4", + "variable_start": 13, "variable_end": 15, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2510,7 +2510,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.991, + "ml_probability": 0.993, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2523,8 +2523,8 @@ "value": "9a2a77d601bb0f013e42c3107ab3a90ec293c88ed56d4388079a3b7380e89bab", "value_start": 28, "value_end": 39, - "variable": "1a38794dddba6a01ff6a949796748aa82faabebae737717ac6bcfbe146122de9", - "variable_start": 9, + "variable": "16e6649c73a7799ff19927fc0806124b282347afb49fcbea1563543088173797", + "variable_start": 16, "variable_end": 27, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2564,7 +2564,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.517, + "ml_probability": 0.476, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2577,8 +2577,8 @@ "value": "22d9eb6734a8dcdbba3feed8603754c1099aac17a1942cd6114801e2b71b65eb", "value_start": 14, "value_end": 25, - "variable": "915c73f26c139fe74d368c41e5435cff17fc2b537056615b49d7f0ccc46c471b", - "variable_start": 3, + "variable": "62a5d3578e6aa1ffe0398d5616125b2a7b891f1ffc08a567059f9bfa95242fcd", + "variable_start": 10, "variable_end": 13, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2672,7 +2672,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.859, + "ml_probability": 0.942, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2685,8 +2685,8 @@ "value": "49b273bbeb3f0b0baf80b252030e2e4cf9917470e20ee810d504f2effbd86181", "value_start": 17, "value_end": 28, - "variable": "7a8beaefca56be0efefee91375c765927d82f36d5b40e09118f39e5846ebcf3a", - "variable_start": 5, + "variable": "d74ff0ee8da3b9806b18c877dbf29bbde50b5bd8e4dad7a3a725000feb82e8f1", + "variable_start": 12, "variable_end": 16, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2753,7 +2753,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.896, + "ml_probability": 0.958, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2766,8 +2766,8 @@ "value": "00b8d2f246babf9e65c204d1a07044c29c5eef1e2e01f46ca5645db80240cca3", "value_start": 15, "value_end": 26, - "variable": "7a8beaefca56be0efefee91375c765927d82f36d5b40e09118f39e5846ebcf3a", - "variable_start": 3, + "variable": "d74ff0ee8da3b9806b18c877dbf29bbde50b5bd8e4dad7a3a725000feb82e8f1", + "variable_start": 10, "variable_end": 14, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2996,7 +2996,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.8, + "ml_probability": 0.854, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -3009,8 +3009,8 @@ "value": "5ab99b9cbdd87f7afc1bc329f007f6f54e9a91ad1723751bc9966dcbd48ac26a", "value_start": 16, "value_end": 27, - "variable": "8fc23288f5726655bf2a811d50cec2318cd8a19dc8b9a2b16db3cc9cb2dafda5", - "variable_start": 5, + "variable": "a1159e9df3670d549d04524532629f5477ceb7deec9b45e47e8c009506ecb2c8", + "variable_start": 12, "variable_end": 15, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -3023,7 +3023,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.991, + "ml_probability": 0.993, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -3036,8 +3036,8 @@ "value": "559bf4ed22ad14d5818cb7a1924ca1cf4dd920c15ca46c644714fb545268049b", "value_start": 33, "value_end": 44, - "variable": "b5e21cfe5a5733091247d23037de41e8bc68f6cb4d6f842f146201d1bd0c4127", - "variable_start": 13, + "variable": "c4b1f195f50a8b0b890986af1a3c32a0ce4d79c3bf714387a6e5d858f3eb2090", + "variable_start": 20, "variable_end": 32, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -3050,7 +3050,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.984, + "ml_probability": 0.987, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -3063,8 +3063,8 @@ "value": "a7980a1e408678e1124d1ac11c815b1ede9e5ddfba7a02c6adf35b736db88c78", "value_start": 32, "value_end": 43, - "variable": "b5e21cfe5a5733091247d23037de41e8bc68f6cb4d6f842f146201d1bd0c4127", - "variable_start": 12, + "variable": "c4b1f195f50a8b0b890986af1a3c32a0ce4d79c3bf714387a6e5d858f3eb2090", + "variable_start": 19, "variable_end": 31, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -3266,7 +3266,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.855, + "ml_probability": 0.794, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -3279,8 +3279,8 @@ "value": "37e3f189ae962a661084ed228bbd4d747b3825125cacd6bf00bc2e2f35a46550", "value_start": 15, "value_end": 26, - "variable": "b48f052814bbd605932530ddfcfdc16211ecd4dab7324ac253587d7836698621", - "variable_start": 5, + "variable": "bc8478052e3ca9de6522b003c9297f7a5319cc5e8477991b48a2402c8c5ced61", + "variable_start": 12, "variable_end": 14, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -3374,7 +3374,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.984, + "ml_probability": 0.988, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -3387,8 +3387,8 @@ "value": "6ba8faf70ef8d724c478e0223d7584b5d92f3416393c54ade4a7ac6e4b983e73", "value_start": 21, "value_end": 32, - "variable": "b107737795e97289a71daa46f9c2f2370ddf3fc2435189a5c2126dc9e6b6a85b", - "variable_start": 5, + "variable": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8", + "variable_start": 12, "variable_end": 20, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -3401,7 +3401,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.945, + "ml_probability": 0.919, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -3414,8 +3414,8 @@ "value": "9c6c9826e17b0805e5a5570faa055fe912e1723a563d63f243deffac39c035e7", "value_start": 20, "value_end": 31, - "variable": "b48f052814bbd605932530ddfcfdc16211ecd4dab7324ac253587d7836698621", - "variable_start": 10, + "variable": "bc8478052e3ca9de6522b003c9297f7a5319cc5e8477991b48a2402c8c5ced61", + "variable_start": 17, "variable_end": 19, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -3455,7 +3455,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.99, + "ml_probability": 0.992, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -3468,8 +3468,8 @@ "value": "5290759ab70c673aee90fb70e07a09c636a7e1ebb29f66578fa3ecbfa1325f8f", "value_start": 21, "value_end": 32, - "variable": "b107737795e97289a71daa46f9c2f2370ddf3fc2435189a5c2126dc9e6b6a85b", - "variable_start": 5, + "variable": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8", + "variable_start": 12, "variable_end": 20, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -3590,7 +3590,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.737, + "ml_probability": 0.804, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -3603,8 +3603,8 @@ "value": "8a2381392b64efec43044b6f61074ae38d0e5977f223afd14ff8cb333c3f0c30", "value_start": 16, "value_end": 27, - "variable": "8fc23288f5726655bf2a811d50cec2318cd8a19dc8b9a2b16db3cc9cb2dafda5", - "variable_start": 5, + "variable": "a1159e9df3670d549d04524532629f5477ceb7deec9b45e47e8c009506ecb2c8", + "variable_start": 12, "variable_end": 15, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -3752,7 +3752,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.073, + "ml_probability": 0.841, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -3765,8 +3765,8 @@ "value": "bde5c17fbd9cb8e91c947b670d226c00e22c2e255477b754a463b13efcd5590a", "value_start": 25, "value_end": 36, - "variable": "d8c6f7623a425129f7ba6ba00c41b2109b72b0bc71fcddedcf7f71377bc1c3f2", - "variable_start": 3, + "variable": "30c952fab122c3f9759f02a6d95c3758b246b4fee239957b2d4fee46e26170c4", + "variable_start": 22, "variable_end": 24, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -3779,7 +3779,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.038, + "ml_probability": 0.747, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -3792,8 +3792,8 @@ "value": "86f24f585f57dccea2c47e0d8fccb6ce9cf80090d3fd2422d0bb5acb18509aea", "value_start": 25, "value_end": 34, - "variable": "d8c6f7623a425129f7ba6ba00c41b2109b72b0bc71fcddedcf7f71377bc1c3f2", - "variable_start": 3, + "variable": "30c952fab122c3f9759f02a6d95c3758b246b4fee239957b2d4fee46e26170c4", + "variable_start": 22, "variable_end": 24, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -6506,7 +6506,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.001, + "ml_probability": 0.997, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -6519,8 +6519,8 @@ "value": "f3fcf01584252467020a8f6276c59117c096dc4449769b6c0f256da58be9cf87", "value_start": 28, "value_end": 36, - "variable": "0ae5a9f26f34faf73b87feee08131a92b79bbff81e403ec17a190a4105f97df4", - "variable_start": 0, + "variable": "30c952fab122c3f9759f02a6d95c3758b246b4fee239957b2d4fee46e26170c4", + "variable_start": 25, "variable_end": 27, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -6830,7 +6830,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.012, + "ml_probability": 0.996, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -6843,8 +6843,8 @@ "value": "f3fcf01584252467020a8f6276c59117c096dc4449769b6c0f256da58be9cf87", "value_start": 22, "value_end": 30, - "variable": "170e93a56e4463e8bf000c4b8bebea376c298da0e350ca88ae517016d3b668f3", - "variable_start": 0, + "variable": "bc8478052e3ca9de6522b003c9297f7a5319cc5e8477991b48a2402c8c5ced61", + "variable_start": 19, "variable_end": 21, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -6897,8 +6897,8 @@ "value": "f3fcf01584252467020a8f6276c59117c096dc4449769b6c0f256da58be9cf87", "value_start": 15, "value_end": 23, - "variable": "18345576151ff690ef97bd271440a4167323faa1d15253bb6df3ffc589d16dae", - "variable_start": 7, + "variable": "bc8478052e3ca9de6522b003c9297f7a5319cc5e8477991b48a2402c8c5ced61", + "variable_start": 12, "variable_end": 14, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -9514,6 +9514,33 @@ } ] }, + { + "api_validation": "NOT_AVAILABLE", + "ml_validation": "VALIDATED_KEY", + "ml_probability": 0.999, + "rule": "Password", + "severity": "medium", + "confidence": "moderate", + "line_data_list": [ + { + "line": "a874d0a0d4096a9f55d0690a75f88becf050a5ff4b90853b49584c7b44cfa0be", + "line_num": 12, + "path": "./tests/samples/password_TRUE", + "info": "", + "value": "9ba90a34405b921f1bb1c212e7eba0257c1af03cdf8d901993e2bcb6808f397e", + "value_start": 49, + "value_end": 60, + "variable": "9a2fb618bc0e7512d120bae894beb970aa267ccc36e6d912ea58ab4072722a97", + "variable_start": 25, + "variable_end": 48, + "entropy_validation": { + "iterator": "BASE64_CHARS", + "entropy": 3.277613436819116, + "valid": false + } + } + ] + }, { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", diff --git a/tests/data/output.json b/tests/data/output.json index 8ec66fd3a..6d368516c 100644 --- a/tests/data/output.json +++ b/tests/data/output.json @@ -1511,7 +1511,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.95, + "ml_probability": 0.963, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -1524,8 +1524,8 @@ "value": "dipPr14Gg!", "value_start": 19, "value_end": 29, - "variable": "master,password", - "variable_start": 3, + "variable": "password", + "variable_start": 10, "variable_end": 18, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -1619,7 +1619,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.956, + "ml_probability": 0.967, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -1632,8 +1632,8 @@ "value": "dipPr19Gg!", "value_start": 25, "value_end": 35, - "variable": "master,password", - "variable_start": 9, + "variable": "password", + "variable_start": 16, "variable_end": 24, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -1646,7 +1646,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.934, + "ml_probability": 0.962, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -1659,8 +1659,8 @@ "value": "dipPr111Gg!", "value_start": 22, "value_end": 33, - "variable": "master,password", - "variable_start": 6, + "variable": "password", + "variable_start": 13, "variable_end": 21, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -1700,7 +1700,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.972, + "ml_probability": 0.98, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -1713,8 +1713,8 @@ "value": "dipPr114Gg!", "value_start": 21, "value_end": 32, - "variable": "master,password", - "variable_start": 5, + "variable": "password", + "variable_start": 12, "variable_end": 20, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -1727,7 +1727,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.988, + "ml_probability": 0.992, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -1740,8 +1740,8 @@ "value": "dipPr115Gg!", "value_start": 21, "value_end": 32, - "variable": "master,password", - "variable_start": 5, + "variable": "password", + "variable_start": 12, "variable_end": 20, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -1808,7 +1808,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.96, + "ml_probability": 0.972, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -1821,8 +1821,8 @@ "value": "dipPr118Gg!", "value_start": 25, "value_end": 36, - "variable": "master,password", - "variable_start": 9, + "variable": "password", + "variable_start": 16, "variable_end": 24, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -1970,7 +1970,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.963, + "ml_probability": 0.972, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -1983,8 +1983,8 @@ "value": "dipPr126Gg!", "value_start": 23, "value_end": 34, - "variable": "master,password", - "variable_start": 7, + "variable": "password", + "variable_start": 14, "variable_end": 22, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2051,7 +2051,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.866, + "ml_probability": 0.908, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2064,8 +2064,8 @@ "value": "dipPr129Gg!", "value_start": 16, "value_end": 27, - "variable": "master,pw", - "variable_start": 6, + "variable": "pw", + "variable_start": 13, "variable_end": 15, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2267,7 +2267,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.991, + "ml_probability": 0.993, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2280,8 +2280,8 @@ "value": "dipPr138Gg!", "value_start": 28, "value_end": 39, - "variable": "master,ANYpassword", - "variable_start": 9, + "variable": "ANYpassword", + "variable_start": 16, "variable_end": 27, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2402,7 +2402,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.859, + "ml_probability": 0.942, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2415,8 +2415,8 @@ "value": "dipPr144Gg!", "value_start": 17, "value_end": 28, - "variable": "master,pass", - "variable_start": 5, + "variable": "pass", + "variable_start": 12, "variable_end": 16, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2483,7 +2483,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.896, + "ml_probability": 0.958, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2496,8 +2496,8 @@ "value": "dipPr147Gg!", "value_start": 15, "value_end": 26, - "variable": "master,pass", - "variable_start": 3, + "variable": "pass", + "variable_start": 10, "variable_end": 14, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2726,7 +2726,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.8, + "ml_probability": 0.854, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2739,8 +2739,8 @@ "value": "dipPr158Gg!", "value_start": 16, "value_end": 27, - "variable": "master,pwd", - "variable_start": 5, + "variable": "pwd", + "variable_start": 12, "variable_end": 15, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2753,7 +2753,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.991, + "ml_probability": 0.993, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2766,8 +2766,8 @@ "value": "dipPr159Gg!", "value_start": 33, "value_end": 44, - "variable": "master,ANY_password", - "variable_start": 13, + "variable": "ANY_password", + "variable_start": 20, "variable_end": 32, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2780,7 +2780,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.984, + "ml_probability": 0.987, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2793,8 +2793,8 @@ "value": "dipPr160Gg!", "value_start": 32, "value_end": 43, - "variable": "master,ANY_password", - "variable_start": 12, + "variable": "ANY_password", + "variable_start": 19, "variable_end": 31, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -2969,7 +2969,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.855, + "ml_probability": 0.794, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -2982,8 +2982,8 @@ "value": "dipPr169Gg!", "value_start": 15, "value_end": 26, - "variable": "master,PW", - "variable_start": 5, + "variable": "PW", + "variable_start": 12, "variable_end": 14, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -3077,7 +3077,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.984, + "ml_probability": 0.988, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -3090,8 +3090,8 @@ "value": "dipPr176Gg!", "value_start": 21, "value_end": 32, - "variable": "master,password", - "variable_start": 5, + "variable": "password", + "variable_start": 12, "variable_end": 20, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -3104,7 +3104,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.945, + "ml_probability": 0.919, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -3117,8 +3117,8 @@ "value": "dipPr177Gg!", "value_start": 20, "value_end": 31, - "variable": "master,PW", - "variable_start": 10, + "variable": "PW", + "variable_start": 17, "variable_end": 19, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -3158,7 +3158,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.99, + "ml_probability": 0.992, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -3171,8 +3171,8 @@ "value": "dipPr179Gg!", "value_start": 21, "value_end": 32, - "variable": "master,password", - "variable_start": 5, + "variable": "password", + "variable_start": 12, "variable_end": 20, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -3266,7 +3266,7 @@ { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.737, + "ml_probability": 0.804, "rule": "Password", "severity": "medium", "confidence": "moderate", @@ -3279,8 +3279,8 @@ "value": "dipPr186Gg!", "value_start": 16, "value_end": 27, - "variable": "master,pwd", - "variable_start": 5, + "variable": "pwd", + "variable_start": 12, "variable_end": 15, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -3398,6 +3398,60 @@ } ] }, + { + "api_validation": "NOT_AVAILABLE", + "ml_validation": "VALIDATED_KEY", + "ml_probability": 0.841, + "rule": "Password", + "severity": "medium", + "confidence": "moderate", + "line_data_list": [ + { + "line": "id:master@example.com,pw:dipPr198Gg!", + "line_num": 99, + "path": "./tests/samples/doc_id_pair_passwd_pair", + "info": "", + "value": "dipPr198Gg!", + "value_start": 25, + "value_end": 36, + "variable": "pw", + "variable_start": 22, + "variable_end": 24, + "entropy_validation": { + "iterator": "BASE64_CHARS", + "entropy": 3.1449378351248165, + "valid": false + } + } + ] + }, + { + "api_validation": "NOT_AVAILABLE", + "ml_validation": "VALIDATED_KEY", + "ml_probability": 0.747, + "rule": "Password", + "severity": "medium", + "confidence": "moderate", + "line_data_list": [ + { + "line": "id:master@example.com,pw:IHQSB1GG!", + "line_num": 102, + "path": "./tests/samples/doc_id_pair_passwd_pair", + "info": "", + "value": "IHQSB1GG!", + "value_start": 25, + "value_end": 34, + "variable": "pw", + "variable_start": 22, + "variable_end": 24, + "entropy_validation": { + "iterator": "BASE64_CHARS", + "entropy": 2.595488890170944, + "valid": false + } + } + ] + }, { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", @@ -5396,6 +5450,33 @@ } ] }, + { + "api_validation": "NOT_AVAILABLE", + "ml_validation": "VALIDATED_KEY", + "ml_probability": 0.997, + "rule": "Password", + "severity": "medium", + "confidence": "moderate", + "line_data_list": [ + { + "line": "gildong.hong@98.76.54.32,pw:IhqSb1Gg", + "line_num": 47, + "path": "./tests/samples/doc_various", + "info": "", + "value": "IhqSb1Gg", + "value_start": 28, + "value_end": 36, + "variable": "pw", + "variable_start": 25, + "variable_end": 27, + "entropy_validation": { + "iterator": "BASE64_CHARS", + "entropy": 3.0, + "valid": false + } + } + ] + }, { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", @@ -5693,6 +5774,33 @@ } ] }, + { + "api_validation": "NOT_AVAILABLE", + "ml_validation": "VALIDATED_KEY", + "ml_probability": 0.996, + "rule": "Password", + "severity": "medium", + "confidence": "moderate", + "line_data_list": [ + { + "line": "master@98.76.54.32,PW:IhqSb1Gg", + "line_num": 74, + "path": "./tests/samples/doc_various", + "info": "", + "value": "IhqSb1Gg", + "value_start": 22, + "value_end": 30, + "variable": "PW", + "variable_start": 19, + "variable_end": 21, + "entropy_validation": { + "iterator": "BASE64_CHARS", + "entropy": 3.0, + "valid": false + } + } + ] + }, { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", @@ -5736,8 +5844,8 @@ "value": "IhqSb1Gg", "value_start": 15, "value_end": 23, - "variable": "xxxx,PW", - "variable_start": 7, + "variable": "PW", + "variable_start": 12, "variable_end": 14, "entropy_validation": { "iterator": "BASE64_CHARS", @@ -8299,6 +8407,33 @@ } ] }, + { + "api_validation": "NOT_AVAILABLE", + "ml_validation": "VALIDATED_KEY", + "ml_probability": 0.999, + "rule": "Password", + "severity": "medium", + "confidence": "moderate", + "line_data_list": [ + { + "line": "MYSQL_DATABASE_USER=CRED;MYSQL_DATABASE_PASSWORD=2IWJD88FH4Y;", + "line_num": 12, + "path": "./tests/samples/password_TRUE", + "info": "", + "value": "2IWJD88FH4Y", + "value_start": 49, + "value_end": 60, + "variable": "MYSQL_DATABASE_PASSWORD", + "variable_start": 25, + "variable_end": 48, + "entropy_validation": { + "iterator": "BASE64_CHARS", + "entropy": 3.277613436819116, + "valid": false + } + } + ] + }, { "api_validation": "NOT_AVAILABLE", "ml_validation": "VALIDATED_KEY", diff --git a/tests/file_handler/test_data_content_provider.py b/tests/file_handler/test_data_content_provider.py index 874df4ba2..5cad6c6d8 100644 --- a/tests/file_handler/test_data_content_provider.py +++ b/tests/file_handler/test_data_content_provider.py @@ -62,34 +62,34 @@ def test_scan_wrong_provider_n(self) -> None: def test_scan_bottom_reach_n(self) -> None: content_provider = DataContentProvider(self.WRONG_ZIP_FILE, "dummy") cs = CredSweeper(json_filename="dummy") - assert len(cs.deep_scanner.recursive_scan(content_provider, 0, 1 << 16)) == 0 + self.assertEqual(0, len(cs.deep_scanner.recursive_scan(content_provider, 0, 1 << 16))) def test_scan_wrong_zip_data_n(self) -> None: content_provider = DataContentProvider(self.WRONG_ZIP_FILE, "dummy") cs = CredSweeper(json_filename="dummy") - assert len(cs.deep_scanner.recursive_scan(content_provider, 1, 1 << 16)) == 0 + self.assertEqual(0, len(cs.deep_scanner.recursive_scan(content_provider, 1, 1 << 16))) def test_scan_empty_zip_n(self) -> None: content_provider = DataContentProvider( b'PK\x05\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', "dummy") cs = CredSweeper(json_filename="dummy") - assert len(cs.deep_scanner.recursive_scan(content_provider, 1, 1 << 16)) == 0 + self.assertEqual(0, len(cs.deep_scanner.recursive_scan(content_provider, 1, 1 << 16))) def test_scan_zipfile_n(self) -> None: with tempfile.TemporaryDirectory() as tmp_dir: report_path = os.path.join(tmp_dir, "report.json") file_path = os.path.join(tmp_dir, "test_n.zip") - assert not os.path.exists(file_path) + self.assertFalse(os.path.exists(file_path)) open(file_path, "wb").write(self.WRONG_ZIP_FILE) content_provider = FilesProvider([tmp_dir]) cs = CredSweeper(json_filename=report_path, depth=1) file_extractors = content_provider.get_scannable_files(cs.config) - assert len(file_extractors) == 1 + self.assertEqual(1, len(file_extractors)) scan_results = cs.file_scan(file_extractors[0]) - assert len(scan_results) == 0 - assert not os.path.isfile(report_path) + self.assertEqual(0, len(scan_results)) + self.assertFalse(os.path.isfile(report_path)) def test_scan_zipfile_p(self) -> None: # create new zip archive with all samples @@ -102,22 +102,21 @@ def test_scan_zipfile_p(self) -> None: # calculate samples content_provider = FilesProvider([SAMPLES_PATH]) file_extractors = content_provider.get_scannable_files(cs.config) - assert len(file_extractors) > 1 + self.assertLess(1, len(file_extractors)) samples_scan_results: List[Candidate] = [] for file_extractor in file_extractors: samples_scan_results.extend(cs.file_scan(file_extractor)) len_samples_scan_results = len(samples_scan_results) - assert len_samples_scan_results > 1 + self.assertLess(1, len_samples_scan_results) cs.credential_manager.set_credentials(samples_scan_results) cs.post_processing() cs.export_results() - assert os.path.isfile(report_path_1) + self.assertTrue(os.path.isfile(report_path_1)) with open(report_path_1) as f: report = json.load(f) len_samples_report = len(report) - assert len_samples_report < len_samples_scan_results - assert len_samples_report > 1 + self.assertTrue(1 < len_samples_report < len_samples_scan_results) # change the report file name cs.json_filename = report_path_2 @@ -128,7 +127,7 @@ def test_scan_zipfile_p(self) -> None: # use the same approach but with single zip file which is made from the samples zip_file_path = os.path.join(tmp_dir, "test_p.zip") - assert not os.path.exists(zip_file_path) + self.assertFalse(os.path.exists(zip_file_path)) samples_file_count = 0 with zipfile.ZipFile(zip_file_path, "a", zipfile.ZIP_DEFLATED, compresslevel=9) as zip_file: for dirpath, dirnames, filenames in os.walk(SAMPLES_PATH): @@ -152,32 +151,34 @@ def test_scan_zipfile_p(self) -> None: cs.post_processing() cs.export_results() - assert os.path.isfile(report_path_1) + self.assertTrue(os.path.isfile(report_path_1)) with open(report_path_1) as f: report = json.load(f) len_samples_report = len(report) - assert len_samples_report < len_samples_scan_results - assert len_samples_report > 1 + self.assertTrue(1 < len_samples_report < len_samples_scan_results) + + def test_scan_zipfile_size_limit_n(self) -> None: + sample_path = SAMPLES_PATH / "pem_key.zip" + cs = CredSweeper() + content_provider = DataContentProvider(open(sample_path, "rb").read(), sample_path) + self.assertEqual(0, len(cs.deep_scanner.recursive_scan(content_provider, 3, 4))) def test_scan_zipfile_size_limit_p(self) -> None: sample_path = SAMPLES_PATH / "pem_key.zip" cs = CredSweeper() content_provider = DataContentProvider(open(sample_path, "rb").read(), sample_path) - res_0 = cs.deep_scanner.recursive_scan(content_provider, 3, 4) - assert len(res_0) == 0 - res_1 = cs.deep_scanner.recursive_scan(content_provider, 3, 1024) - assert len(res_1) == 1 + self.assertEqual(1, len(cs.deep_scanner.recursive_scan(content_provider, 3, 1024))) def test_scan_zipfile_bomb_1_n(self) -> None: # create with depth to remove *.zip extension cs = CredSweeper(depth=2) content_provider = DataContentProvider(zb1, "zip_bomb_1") res_1 = cs.deep_scanner.recursive_scan(content_provider, 2, 1 << 30) - assert len(res_1) == 0 + self.assertEqual(0, len(res_1)) def test_scan_zipfile_bomb_2_n(self) -> None: # create with depth to remove *.zip extension cs = CredSweeper(depth=4) content_provider = DataContentProvider(zb2, "zip_bomb_2") res_2 = cs.deep_scanner.recursive_scan(content_provider, 16, 1 << 16) - assert len(res_2) == 0 + self.assertEqual(0, len(res_2)) diff --git a/tests/filters/test_line_uue_part_check.py b/tests/filters/test_line_uue_part_check.py new file mode 100644 index 000000000..7044c9dc7 --- /dev/null +++ b/tests/filters/test_line_uue_part_check.py @@ -0,0 +1,49 @@ +from unittest import TestCase + +import pytest + +from credsweeper.file_handler.analysis_target import AnalysisTarget +from credsweeper.filters import LineSpecificKeyCheck, LineGitBinaryCheck +from credsweeper.filters.line_uue_part_check import LineUUEPartCheck +from tests.filters.conftest import LINE_VALUE_PATTERN, DUMMY_ANALYSIS_TARGET, DUMMY_DESCRIPTOR +from tests.test_utils.dummy_line_data import get_line_data + + +class TestLineUUEPartCheck(TestCase): + + def test_line_uue_part_check_short_n(self): + line = """#````""" + cred_candidate = get_line_data(line=line, pattern=LINE_VALUE_PATTERN) + target = AnalysisTarget(line_pos=0, lines=[line, line], line_nums=[1, 2], descriptor=DUMMY_DESCRIPTOR) + self.assertFalse(LineUUEPartCheck().run(cred_candidate, target)) + + def test_line_uue_part_check_uue__n(self): + line = """M[@%]PW:2Z.Q?2M^S;`4G?E0C.@V&?0KY]]"H3Y@6$#I4V*R^"+B,2P6`A)UL""" + cred_candidate = get_line_data(line=line, pattern=LINE_VALUE_PATTERN) + cred_candidate.line_pos = 1 + target = AnalysisTarget(line_pos=1, + lines=["begin 644 x3wo.bin", line, "#````", "`", "end"], + line_nums=[1, 2, 3, 4, 5], + descriptor=DUMMY_DESCRIPTOR) + self.assertFalse(LineUUEPartCheck().run(cred_candidate, target)) + + def test_line_uue_part_single_n(self): + line = """M[@%]PW:2Z.Q?2M^S;`4G?E0C.@V&?0KY]]"H3Y@6$#I4V*R^"+B,2P6`A)UL""" + cred_candidate = get_line_data(line=line, pattern=LINE_VALUE_PATTERN) + target = AnalysisTarget(line_pos=0, lines=[line], line_nums=[1], descriptor=DUMMY_DESCRIPTOR) + self.assertFalse(LineUUEPartCheck().run(cred_candidate, target)) + + def test_line_uue_part_check_n(self): + line = """M[@%]PW:2Z.Q?2M^S;`4G?E0C.@V&?0KY]]"H3Y@6$#I4V*R^"D+lowercase""" + cred_candidate = get_line_data(line=line, pattern=LINE_VALUE_PATTERN) + target = AnalysisTarget(line_pos=0, lines=[line, line], line_nums=[1, 2], descriptor=DUMMY_DESCRIPTOR) + self.assertFalse(LineUUEPartCheck().run(cred_candidate, target)) + + def test_line_uue_part_check_p(self): + line = """M[@%]PW:2Z.Q?2M^S;`4G?E0C.@V&?0KY]]"H3Y@6$#I4V*R^"+B,2P6`A)UL""" + cred_candidate = get_line_data(line=line, pattern=LINE_VALUE_PATTERN) + target = AnalysisTarget(line_pos=0, lines=[line, line], line_nums=[1, 2], descriptor=DUMMY_DESCRIPTOR) + self.assertTrue(LineUUEPartCheck().run(cred_candidate, target)) + # check for empty line + cred_candidate.line = '' + self.assertTrue(LineUUEPartCheck().run(cred_candidate, target)) diff --git a/tests/filters/test_value_array_dictionary_check.py b/tests/filters/test_value_array_dictionary_check.py index afdc30d3e..d1ebb71d3 100644 --- a/tests/filters/test_value_array_dictionary_check.py +++ b/tests/filters/test_value_array_dictionary_check.py @@ -40,7 +40,7 @@ def test_value_array_dictionary_n(self, token_rule: Rule, file_path: pytest.fixt "passwd[i] = 'root'", "users[i] = {passwd: 'root'}", "user = {passwd: 'root'}", "passwd = {'root'}", "user = get_user_data(passwd='root', user=users[i])", "user = get_user_data(user=users[i], passwd='root')" ]) - def test_array_assignment_p(self, token_rule: Rule, file_path: pytest.fixture, line: str) -> None: + def test_array_assignment_n(self, token_rule: Rule, file_path: pytest.fixture, line: str) -> None: """Evaluate that filter do not remove assignments to array or dictionary declaration""" line_data = get_line_data(file_path, line=line, pattern=token_rule.patterns[0]) assert ValueArrayDictionaryCheck().run(line_data, DUMMY_ANALYSIS_TARGET) is False diff --git a/tests/filters/test_value_string_type_check.py b/tests/filters/test_value_string_type_check.py index 05713ccaf..044f8ecb7 100644 --- a/tests/filters/test_value_string_type_check.py +++ b/tests/filters/test_value_string_type_check.py @@ -26,7 +26,7 @@ def test_value_string_type_check_none_path_n(self, config: Config, success_line: assert ValueStringTypeCheck(config).run(line_data, DUMMY_ANALYSIS_TARGET) is False @pytest.mark.parametrize("line", ["pass = test_key"]) - def test_value_string_type_check_not_quoted_source_file_p(self, line: str, config: Config) -> None: + def test_value_string_type_check_not_quoted_source_file_n(self, line: str, config: Config) -> None: file_path = "path.yaml" line_data = get_line_data( config, diff --git a/tests/ml_model/test_ml_validator.py b/tests/ml_model/test_ml_validator.py index 533577c15..7c225e341 100644 --- a/tests/ml_model/test_ml_validator.py +++ b/tests/ml_model/test_ml_validator.py @@ -37,7 +37,7 @@ def validate(self, _candidate: Candidate) -> Tuple[bool, float]: is_cred_batch, probability_batch = self.ml_validator.validate_groups(sample_as_batch, 1) return is_cred_batch[0], probability_batch[0] - def test_ml_validator_simple_p(self): + def test_ml_validator_simple_n(self): candidate = Candidate.get_dummy_candidate(self.config, "main.py", ".py", "info") candidate.rule_name = "Password" candidate.line_data_list[0].line = 'password="Ahga%$FiQ@Ei8"' @@ -170,7 +170,7 @@ def test_extract_features_p(self): features3 = self.ml_validator.extract_features([candidate1, candidate2]) self.assertEqual(17 + 1, np.count_nonzero(features3)) - def testVariableNotAllowedPatternCheck_p(self): + def testVariableNotAllowedPatternCheck_n(self): candidate1 = Candidate.get_dummy_candidate(self.config, "???.py", ".py", "") candidate1.line_data_list[0].line = '?????????????:!!!!!!!!!!!!!' candidate1.line_data_list[0].variable = "?????????????" diff --git a/tests/samples/password_FALSE b/tests/samples/password_FALSE index 9032efce9..e0eab234b 100644 --- a/tests/samples/password_FALSE +++ b/tests/samples/password_FALSE @@ -1,2 +1,6 @@ password = "abc" RUN openssl x509 -req -days 365 -passin "file:dkajco1" -sha256 -in server.csr -CA ca.pem -CAkey ca-key + +# two lines for UUE filter +M[@%]PW:2Z.Q?2M^S;`4G?E0C.@V&?0KY]]"H3Y@6$#I4V*R^"+B,2P6`A)UL +M>1D!ZT;JA?AD9%I_+YD/,6X7/D-LCAWT\/Y<+1-JL*"1UX/I731CLB<\Q=CZ diff --git a/tests/samples/password_TRUE b/tests/samples/password_TRUE index 1b3abf521..1744d7249 100644 --- a/tests/samples/password_TRUE +++ b/tests/samples/password_TRUE @@ -6,3 +6,7 @@ if passworsd == "q4c1a2oPd": # __eq__ separator if passworsd != "x6s7djtEa": # __ne__ separator password=2bkJgtJDiLcq1t RUN openssl x509 -req -days 365 -passin "pass:nCzx8A8#!" -sha256 -in server.csr -CA ca.pem -CAkey ca-key + +# UUE must not skip due `localhost` in lower +MYSQL_DATABASE_HOSTNAME=localhost;MYSQL_DATABASE_PORT=655351; +MYSQL_DATABASE_USER=CRED;MYSQL_DATABASE_PASSWORD=2IWJD88FH4Y; diff --git a/tests/test_main.py b/tests/test_main.py index c1e30fbe6..e38a662be 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -102,8 +102,7 @@ def test_use_filters_n(self) -> None: files_provider = [TextContentProvider(SAMPLES_PATH / "password_FALSE")] cred_sweeper.scan(files_provider) creds = cred_sweeper.credential_manager.get_credentials() - self.assertEqual(1, len(creds)) - self.assertEqual('password = "abc"', creds[0].line_data_list[0].line) + self.assertEqual(2, len(creds)) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # diff --git a/tests/utils/test_util.py b/tests/utils/test_util.py index cdcaef7eb..8ccee3903 100644 --- a/tests/utils/test_util.py +++ b/tests/utils/test_util.py @@ -585,7 +585,7 @@ def test_get_chunks_p(self): ], # Util.get_chunks(line_length)) - def test_get_chunks_coverage_p(self): + def test_get_chunks_coverage_n(self): line_len = MAX_LINE_LENGTH while 7 * MAX_LINE_LENGTH > line_len: line_len += random.randint(1, OVERLAP_SIZE)