44import zipfile
55
66from .base import (
7+ Any ,
78 Boolean ,
89 Const ,
910 Dict ,
@@ -185,10 +186,13 @@ def _get_burp_software_content(content, _):
185186 ("sw_edition" , String (required = False )),
186187 ("target_sw" , String (required = False )),
187188 ("target_hw" , String (required = False )),
188- ("respect_major_version" , String (required = False , choices = ["yes" , "no" , "true" , "false" ])),
189+ (
190+ "respect_major_version" ,
191+ String (required = False , choices = ["yes" , "no" , "true" , "false" ]),
192+ ),
189193 ("exclude_any_version" , String (required = False , choices = ["yes" , "no" , "true" , "false" ])),
190- ("type" , String (required = False )), # deprecated
191- ("exactmatch" , Boolean (default = False )), # deprecated
194+ ("type" , String (required = False )), # deprecated
195+ ("exactmatch" , Boolean (default = False )), # deprecated
192196 ],
193197 content_handler = _get_burp_software_content ,
194198 )
@@ -208,8 +212,13 @@ def get_software_vulnerabilities(
208212 target_hw = None ,
209213 respect_major_version = None ,
210214 exclude_any_version = None ,
211- only_ids = None
215+ only_ids = None ,
212216 ):
217+ warnings .warn (
218+ "get_software_vulnerabilities() is deprecated and will be removed in future release. "
219+ "Use VulnersApi.audit_software() or VulnersApi.audit_host() instead." ,
220+ DeprecationWarning ,
221+ )
213222 """
214223 Find software vulnerabilities using name and version.
215224
@@ -227,16 +236,45 @@ def get_software_vulnerabilities(
227236 target_hw ,
228237 respect_major_version ,
229238 exclude_any_version ,
230- only_ids
239+ only_ids ,
231240 )
232241
242+ audit_software = Endpoint (
243+ method = "post" ,
244+ url = "/api/v4/audit/software-batch/" ,
245+ params = [
246+ (
247+ "software" ,
248+ List (
249+ item = Dict (),
250+ description = "List of dicts. E.g., [{'product': 'curl', 'version': '8.11.1', ...}, ...]" ,
251+ ),
252+ ),
253+ ],
254+ content_handler = lambda c , _ : c ["result" ],
255+ )
256+
257+ audit_host = Endpoint (
258+ method = "post" ,
259+ url = "/api/v4/audit/host/" ,
260+ params = [
261+ (
262+ "software" ,
263+ List (
264+ item = Dict (),
265+ description = "List of dicts. E.g., [{'product': 'curl', 'version': '8.11.1', ...}, ...]" ,
266+ ),
267+ ),
268+ ("application" , Any (String , Dict , required = False )),
269+ ("operation_system" , Any (String , Dict , required = False )),
270+ ("hardware" , Any (String , Dict , required = False )),
271+ ],
272+ content_handler = lambda c , _ : c ["result" ],
273+ )
274+
233275 @validate_params (cpe = String ())
234276 def get_cpe_vulnerabilities (
235- self ,
236- cpe ,
237- respect_major_version = None ,
238- exclude_any_version = None ,
239- only_ids = None
277+ self , cpe , respect_major_version = None , exclude_any_version = None , only_ids = None
240278 ):
241279 """
242280 Find software vulnerabilities using CPE string. See CPE references at https://cpe.mitre.org/specification/
@@ -654,7 +692,7 @@ def scanlist_report(self, limit=30, offset=0, filter=None, sort=""):
654692 ("format" , String (default = "html" , choices = ("html" , "json" , "pdf" ))),
655693 ("crontab" , String (allow_null = True , default = None )),
656694 ("query_type" , String (default = "lucene" )),
657- ]
695+ ],
658696 )
659697
660698 edit_subscription = Endpoint (
@@ -664,16 +702,19 @@ def scanlist_report(self, limit=30, offset=0, filter=None, sort=""):
664702 ("subscriptionid" , String ()),
665703 ("format" , String (allow_null = True , default = None , choices = ("html" , "json" , "pdf" ))),
666704 ("crontab" , String (allow_null = True , default = None )),
667- ("active" , String (allow_null = True , default = None , choices = ("yes" , "no" , "true" , "false" ))),
668- ]
705+ (
706+ "active" ,
707+ String (allow_null = True , default = None , choices = ("yes" , "no" , "true" , "false" )),
708+ ),
709+ ],
669710 )
670711
671712 delete_subscription = Endpoint (
672713 method = "post" ,
673714 url = "/api/v3/subscriptions/removeEmailSubscription/" ,
674715 params = [
675716 ("subscriptionid" , String ()),
676- ]
717+ ],
677718 )
678719
679720 get_webhooks = Endpoint (
0 commit comments