From 83ef84a420f820c3508a4877bb1cc4db1d2db78b Mon Sep 17 00:00:00 2001 From: Timo Pollmeier Date: Fri, 15 Nov 2024 10:55:10 +0100 Subject: [PATCH] Add matchStringSearch parameter for CPE match API --- pontos/nvd/cpe_match/api.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pontos/nvd/cpe_match/api.py b/pontos/nvd/cpe_match/api.py index da8da500a..156501dff 100644 --- a/pontos/nvd/cpe_match/api.py +++ b/pontos/nvd/cpe_match/api.py @@ -89,6 +89,7 @@ def cpe_matches( last_modified_start_date: Optional[datetime] = None, last_modified_end_date: Optional[datetime] = None, cve_id: Optional[str] = None, + match_string_search: Optional[str] = None, request_results: Optional[int] = None, start_index: int = 0, results_per_page: Optional[int] = None, @@ -102,6 +103,7 @@ def cpe_matches( last_modified_start_date: Return all CPE matches last modified after this date. last_modified_end_date: Return all CPE matches last modified before this date. cve_id: Return all CPE matches for this Common Vulnerabilities and Exposures identifier. + match_string_search: Return all CPE matches that conform to the given pattern request_results: Number of CPE matches to download. Set to None (default) to download all available matches. start_index: Index of the first CPE match to be returned. Useful @@ -141,6 +143,8 @@ def cpe_matches( if cve_id: params["cveId"] = cve_id + if match_string_search: + params["matchStringSearch"] = match_string_search results_per_page = min( results_per_page or MAX_CPE_MATCHES_PER_PAGE,