diff options
| author | GeogeFI | 2022-12-27 21:51:23 +0100 |
|---|---|---|
| committer | GeogeFI | 2022-12-27 21:51:23 +0100 |
| commit | 864a725b6a1c5f56daa7dc17a47b7daa758c94c3 (patch) | |
| tree | c2245c4cda91bdd31a9b4660bb427948ea1b9f76 | |
| parent | 40cbd0572ec5ea7454145303fc8bf1d0c71d9682 (diff) | |
| download | sec-certs-864a725b6a1c5f56daa7dc17a47b7daa758c94c3.tar.gz sec-certs-864a725b6a1c5f56daa7dc17a47b7daa758c94c3.tar.zst sec-certs-864a725b6a1c5f56daa7dc17a47b7daa758c94c3.zip | |
tests: Prepared fixture setup for cpe config match test
| -rw-r--r-- | tests/cc/test_cc_analysis.py | 39 | ||||
| -rw-r--r-- | tests/test_cve.py | 2 |
2 files changed, 40 insertions, 1 deletions
diff --git a/tests/cc/test_cc_analysis.py b/tests/cc/test_cc_analysis.py index 0c660f04..fa0eecd7 100644 --- a/tests/cc/test_cc_analysis.py +++ b/tests/cc/test_cc_analysis.py @@ -105,6 +105,45 @@ def reference_dataset(data_dir) -> CCDataset: def transitive_vulnerability_dataset(data_dir) -> CCDataset: return CCDataset.from_json(data_dir / "transitive_vulnerability_dataset.json") +@pytest.fixture(scope="module") +def ibm_cpe_configuration() -> CPEConfiguration: + return CPEConfiguration( + "cpe:2.3:o:ibm:zos:*:*:*:*:*:*:*:*", + { + "cpe:2.3:a:ibm:websphere_application_server:7.0:*:*:*:*:*:*:*", + "cpe:2.3:a:ibm:websphere_application_server:7.0.0.1:*:*:*:*:*:*:*", + "cpe:2.3:a:ibm:websphere_application_server:7.0.0.2:*:*:*:*:*:*:*", + "cpe:2.3:a:ibm:websphere_application_server:7.0.0.3:*:*:*:*:*:*:*", + "cpe:2.3:a:ibm:websphere_application_server:7.0.0.4:*:*:*:*:*:*:*", + "cpe:2.3:a:ibm:websphere_application_server:7.0.0.5:*:*:*:*:*:*:*", + "cpe:2.3:a:ibm:websphere_application_server:7.0.0.6:*:*:*:*:*:*:*", + "cpe:2.3:a:ibm:websphere_application_server:7.0.0.7:*:*:*:*:*:*:*", + "cpe:2.3:a:ibm:websphere_application_server:7.0.0.8:*:*:*:*:*:*:*", + "cpe:2.3:a:ibm:websphere_application_server:7.0.0.9:*:*:*:*:*:*:*", + "cpe:2.3:a:ibm:websphere_application_server:*:*:*:*:*:*:*:*", + }, + ) + + +@pytest.fixture(scope="module") +def ibm_xss_cve(ibm_cpe_configuration) -> CVE: + return CVE( + "CVE-2010-2325", + set(), + {ibm_cpe_configuration}, + CVE.Impact(4.3, "MEDIUM", 2.9, 8.6), + "2000-06-18T04:15Z", + {"CWE-79"}, + ) + + +@pytest.fixture(scope="module") +def cpes_ibm_websphere_app_with_platform() -> set[CPE]: + return { + CPE("cpe:2.3:o:ibm:zos:*:*:*:*:*:*:*:*", "IBM zOS"), + CPE("cpe:2.3:a:ibm:websphere_application_server:*:*:*:*:*:*:*:*", "IBM WebSphere Application Server"), + } + @pytest.fixture def random_certificate(cc_dset: CCDataset) -> CCCertificate: diff --git a/tests/test_cve.py b/tests/test_cve.py index 441c3c34..01352db0 100644 --- a/tests/test_cve.py +++ b/tests/test_cve.py @@ -81,7 +81,7 @@ def cves() -> list[CVE]: set(), CVE.Impact(8.2, "HIGH", 3.9, 4.2), "2000-05-26T04:15Z", - {"CVE-611"}, + {"CWE-611"}, ), ] |
