Skip to content

Commit a016881

Browse files
authored
Merge pull request #40 from olgaKiseleva/v2.0
added getsploit and hostvulns_report endpoints
2 parents d84faf9 + fea4647 commit a016881

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

vulners/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
__version__ = "2.0.8"
3+
__version__ = "2.0.9"
44

55
import warnings
66
from .vulners import VulnersApi, Vulners

vulners/vulners.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,13 @@ def _unpack_json_file(c, _):
430430
content_handler=_unpack_json_file,
431431
)
432432

433+
getsploit = Endpoint(
434+
method="get",
435+
url="/api/v3/archive/getsploit/",
436+
params=[],
437+
result_type="zip",
438+
)
439+
433440
del _unpack_json_file
434441

435442
@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=''):
596603
]
597604
)
598605

606+
@validate_params(
607+
limit=Integer(minimum=1, maximum=10000),
608+
offset=Integer(minimum=0, maximum=10000),
609+
filter=Dict(),
610+
sort=String()
611+
)
612+
def hostvulns_report(self, limit=30, offset=0, filter=None, sort=''):
613+
"""
614+
Get Linux Audit results. Return list of hosts and host vulnerabilities:
615+
host ip and fqdn, os name and version, cumulative fix, vulnerability ids
616+
617+
limit: The maximum number of items to return. 10000 is the hard limit.
618+
offset: Skip this amount of items. 10000 is the hard limit.
619+
filter: Dict of fields to filter, eg { 'OS': 'Centos', 'OSVersion': '7'}
620+
sort: Field to sort, eg 'modified' or '-modified' to sort desc
621+
"""
622+
623+
return self.__report("hostvulns", offset, limit, filter or {}, sort)
624+
599625

600626
_Unset = object()
601627

0 commit comments

Comments
 (0)