From 509d1658c3ad02692938031b9b889ab49a71b2b6 Mon Sep 17 00:00:00 2001 From: olgaKiseleva Date: Wed, 22 Feb 2023 12:03:43 +0300 Subject: [PATCH 1/2] added getsploit and hostvulns_report endpoints --- vulners/vulners.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/vulners/vulners.py b/vulners/vulners.py index 43bc6c9..e5ce5e6 100644 --- a/vulners/vulners.py +++ b/vulners/vulners.py @@ -430,6 +430,13 @@ def _unpack_json_file(c, _): content_handler=_unpack_json_file, ) + getsploit = Endpoint( + method="get", + url="/api/v3/archive/getsploit/", + params=[], + result_type="zip", + ) + del _unpack_json_file @validate_params(collection=String(), start_date=String(), end_date=String()) @@ -596,6 +603,25 @@ def scanlist_report(self, limit=30, offset=0, filter=None, sort=''): ] ) + @validate_params( + limit=Integer(minimum=1, maximum=10000), + offset=Integer(minimum=0, maximum=10000), + filter=Dict(), + sort=String() + ) + def hostvulns_report(self, limit=30, offset=0, filter=None, sort=''): + """ + Get Linux Audit results. Return list of hosts and host vulnerabilities: + host ip and fqdn, os name and version, cumulative fix, vulnerability ids + + limit: The maximum number of items to return. 10000 is the hard limit. + offset: Skip this amount of items. 10000 is the hard limit. + filter: Dict of fields to filter, eg { 'OS': 'Centos', 'OSVersion': '7'} + sort: Field to sort, eg 'modified' or '-modified' to sort desc + """ + + return self.__report("hostvulns", offset, limit, filter or {}, sort) + _Unset = object() From fea46472923cf8b894eea4234818a4438093da51 Mon Sep 17 00:00:00 2001 From: olgaKiseleva Date: Wed, 22 Feb 2023 12:04:45 +0300 Subject: [PATCH 2/2] version increment --- vulners/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vulners/__init__.py b/vulners/__init__.py index 04e8b9a..d187659 100644 --- a/vulners/__init__.py +++ b/vulners/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -__version__ = "2.0.8" +__version__ = "2.0.9" import warnings from .vulners import VulnersApi, Vulners