Vulnerabilities
Methods described in this section relate to the the vulnerabilities API.
These methods can be accessed at TenableOT.vulns
.
-
class VulnsAPI(api)[source]
-
assets_list()[source]
Returns a summarization showing the count of assets that have each
vulnerability definition.
- Returns
The list of vulnerability definition asset summaries.
- Return type
list
Example
>>> summaries = ot.vulns.assets_list()
Returns an iterator that handles blending the vulnerability definition
data and asset data into a “vulnerability instance” as is commonly seen
in Tenable.io and Tenable.sc
- Returns
The iterator object handling the data blending.
- Return type
VulnAssetIntermixer
Example
>>> for vuln in ot.vulns.extract():
... print(vuln)
-
list(**kwargs)[source]
Returns a list of vulnerability definitions.
- Returns
The list of vulnerability definitions.
- Return type
list
Example
>>> vulns = ot.vulns.list()
-
vuln_assets(id, **kwargs)[source]
Retrieves the list of assets that have a given vulnerability
definition.
- Parameters
id (str) – The unique identifier for the vuln definition.
- Returns
An iterator object that will handle pagination of the data.
- Return type
OTIterator
Example
>>> for asset in ot.vulns.vuln_assets(id):
... print(asset)
-
class VulnAssetIntermixer(api)[source]
This iterator will make the appropriate calls to construct a “vulnerability
instance” similar to the Tenable.io vuln export APIs and the Tenable.sc
analysis APIs.
Note
This iterator should not be instantiated on your own. It relies on
parameters passed from tenable.ot.vulns.VulnsAPI.export()
.
Example
>>> vulns = ot.vulns.extract()
>>> for vuln in vulns:
... print(vuln)
-
next()[source]
Retrieves the next item.
Note
The next method of the iterator is called automatically when using
the iterator as an iterable (for example within a for loop). Using
next manually should only be used when you want to advance the
iterator on your own.
- Returns
The next vulnerability instance item.
- Return type
dict