@@ -580,7 +580,7 @@ def cve_validate(version, file):
580580@click .option ("--product" , default = None , help = "Product to research." )
581581@click .option ("--push/--no-push" , default = False , help = "Push to RVD in a new ticket." )
582582@cve .command ("search" )
583- def cve_search (all , vendor , product , push ):
583+ def cve_search (all , vendor , product , push , base_url = None ):
584584 """
585585 Search CVEs and CPEs from cve-search enabled DB, import them.
586586
@@ -590,14 +590,19 @@ def cve_search(all, vendor, product, push):
590590 Makes use of the following:
591591 - https://github.com/cve-search/PyCVESearch
592592 - (indirectly) https://github.com/cve-search/cve-search
593+
594+ :param base_url: The base URL for the CVE search API (required). If not provided, the default URL will be used.
593595 """
594596 # cve = CVESearch()
595597 cyan ("Searching for CVEs and CPEs with cve-search ..." )
596598 from pycvesearch import CVESearch
597599
600+ if base_url is None :
601+ base_url = "https://cvepremium.circl.lu/"
602+
598603 if all :
599604 if vendor :
600- cve = CVESearch ()
605+ cve = CVESearch (base_url = base_url )
601606 vendor_flaws = cve .browse (vendor )
602607 products = vendor_flaws ["product" ]
603608 for product in products :
@@ -666,7 +671,7 @@ def cve_search(all, vendor, product, push):
666671 return
667672
668673 if vendor and product :
669- cve = CVESearch ()
674+ cve = CVESearch (base_url = base_url )
670675 cyan ("Searching for vendor/product: " , end = "" )
671676 print (vendor + "/" + product )
672677 results = cve .search (vendor + "/" + product )
@@ -725,7 +730,7 @@ def cve_search(all, vendor, product, push):
725730 pusher .update_ticket (issue , new_flaw )
726731
727732 elif vendor :
728- cve = CVESearch ()
733+ cve = CVESearch (base_url = base_url )
729734 cyan ("Browsing for vendor: " , end = "" )
730735 print (vendor )
731736 # pprint.pprint(cve.browse(vendor))
0 commit comments