From adca91e473f747add0b3ecd0e0ae8bd900f78e04 Mon Sep 17 00:00:00 2001 From: Roman Babenko Date: Mon, 6 Nov 2023 07:56:48 +0200 Subject: [PATCH] one FP update --- tests/__init__.py | 4 ++-- tests/data/depth_3.json | 24 ------------------------ tests/data/doc.json | 24 ------------------------ tests/data/ml_threshold_0.json | 12 ++++++------ tests/data/output.json | 24 ------------------------ tests/samples/doc_id_pair_passwd_pair | 3 ++- tests/test_doc.py | 2 +- 7 files changed, 11 insertions(+), 82 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index 367257394..fa78b4fd7 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -8,10 +8,10 @@ SAMPLES_CRED_LINE_COUNT: int = 405 # credentials count after post-processing -SAMPLES_POST_CRED_COUNT: int = 299 +SAMPLES_POST_CRED_COUNT: int = 298 # with option --doc -SAMPLES_IN_DOC = 390 +SAMPLES_IN_DOC = 389 # archived credentials that are not found without --depth SAMPLES_IN_DEEP_1 = SAMPLES_POST_CRED_COUNT + 21 diff --git a/tests/data/depth_3.json b/tests/data/depth_3.json index 3fdb6d6c3..e3ac8bb32 100644 --- a/tests/data/depth_3.json +++ b/tests/data/depth_3.json @@ -2477,30 +2477,6 @@ } ] }, - { - "api_validation": "NOT_AVAILABLE", - "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.65054, - "rule": "Password", - "severity": "medium", - "line_data_list": [ - { - "line": "# FALSE id:master@example.com,pw:ihqSbGg!", - "line_num": 101, - "path": "tests/samples/doc_id_pair_passwd_pair", - "info": "tests/samples/doc_id_pair_passwd_pair|RAW", - "value": "ihqSbGg!", - "value_start": 33, - "value_end": 41, - "variable": "master@example.com,pw", - "entropy_validation": { - "iterator": "BASE64_CHARS", - "entropy": 2.625, - "valid": false - } - } - ] - }, { "api_validation": "NOT_AVAILABLE", "ml_validation": "NOT_AVAILABLE", diff --git a/tests/data/doc.json b/tests/data/doc.json index 8479ebca5..374d8a975 100644 --- a/tests/data/doc.json +++ b/tests/data/doc.json @@ -5429,30 +5429,6 @@ } ] }, - { - "api_validation": "NOT_AVAILABLE", - "ml_validation": "NOT_AVAILABLE", - "ml_probability": null, - "rule": "PASSWD_PAIR", - "severity": "medium", - "line_data_list": [ - { - "line": "# FALSE id:master@example.com,pw:ihqSbGg!", - "line_num": 101, - "path": "tests/samples/doc_id_pair_passwd_pair", - "info": "tests/samples/doc_id_pair_passwd_pair|RAW", - "value": "ihqSbGg!", - "value_start": 33, - "value_end": 41, - "variable": "pw", - "entropy_validation": { - "iterator": "BASE64_CHARS", - "entropy": 2.625, - "valid": false - } - } - ] - }, { "api_validation": "NOT_AVAILABLE", "ml_validation": "NOT_AVAILABLE", diff --git a/tests/data/ml_threshold_0.json b/tests/data/ml_threshold_0.json index a6563912d..1ae463301 100644 --- a/tests/data/ml_threshold_0.json +++ b/tests/data/ml_threshold_0.json @@ -2605,17 +2605,17 @@ "severity": "medium", "line_data_list": [ { - "line": "# FALSE id:master@example.com,pw:ihqSbGg!", - "line_num": 101, + "line": "id:master@example.com,pw:IHQSB1GG!", + "line_num": 102, "path": "tests/samples/doc_id_pair_passwd_pair", "info": "", - "value": "ihqSbGg!", - "value_start": 33, - "value_end": 41, + "value": "IHQSB1GG!", + "value_start": 25, + "value_end": 34, "variable": "master@example.com,pw", "entropy_validation": { "iterator": "BASE64_CHARS", - "entropy": 2.625, + "entropy": 2.595488890170944, "valid": false } } diff --git a/tests/data/output.json b/tests/data/output.json index 498e632f9..3306d88ac 100644 --- a/tests/data/output.json +++ b/tests/data/output.json @@ -2453,30 +2453,6 @@ } ] }, - { - "api_validation": "NOT_AVAILABLE", - "ml_validation": "VALIDATED_KEY", - "ml_probability": 0.65054, - "rule": "Password", - "severity": "medium", - "line_data_list": [ - { - "line": "# FALSE id:master@example.com,pw:ihqSbGg!", - "line_num": 101, - "path": "tests/samples/doc_id_pair_passwd_pair", - "info": "", - "value": "ihqSbGg!", - "value_start": 33, - "value_end": 41, - "variable": "master@example.com,pw", - "entropy_validation": { - "iterator": "BASE64_CHARS", - "entropy": 2.625, - "valid": false - } - } - ] - }, { "api_validation": "NOT_AVAILABLE", "ml_validation": "NOT_AVAILABLE", diff --git a/tests/samples/doc_id_pair_passwd_pair b/tests/samples/doc_id_pair_passwd_pair index 8fa84ba21..5aec12305 100644 --- a/tests/samples/doc_id_pair_passwd_pair +++ b/tests/samples/doc_id_pair_passwd_pair @@ -98,4 +98,5 @@ master@98.76.54.32 mailto:{1} (password-ihqSb1Gg!) # skip id: master pw:ihqSb1Gg! id:master@example.com,pw:ihqSb1Gg! -# FALSE id:master@example.com,pw:ihqSbGg! +# FALSE +id:master@example.com,pw:IHQSB1GG! \ No newline at end of file diff --git a/tests/test_doc.py b/tests/test_doc.py index 29c136bbd..e376481fd 100644 --- a/tests/test_doc.py +++ b/tests/test_doc.py @@ -44,7 +44,7 @@ def test_id_pair_passwd_pair_p(self) -> None: content_provider: FilesProvider = TextProvider([SAMPLES_PATH / "doc_id_pair_passwd_pair"]) self.cred_sweeper.run(content_provider=content_provider) found_credentials = self.cred_sweeper.credential_manager.get_credentials() - self.assertEqual(157, len(found_credentials), found_credentials) + self.assertEqual(156, len(found_credentials), found_credentials) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #