Plugins

The following methods allow for interaction into the Tenable Vulnerability Management plugins API endpoints.

Methods available on tio.plugins:

class PluginsAPI(api: APISession)[source]

This will contain all methods related to plugins

families()[source]

List the available plugin families.

plugins: families

Returns:

List of plugin family resource records.

Return type:

list

Examples

>>> for family in tio.plugins.families():
...     pprint(family)
family_details(family_id)[source]

Retrieve the details for a specific plugin family.

plugins: family-details

Parameters:

family_id (int) – The plugin family unique identifier.

Returns:

Returns a dictionary stating the id, name, and plugins that are housed within the plugin family.

Return type:

dict

Examples

>>> family = tio.plugins.family_details(1)
list(page=None, size=None, last_updated=None, num_pages=None)[source]

Get the listing of plugin details from Tenable Vulnerability Management.

plugins: list

Parameters:
  • size (int, optional) – The number of records to retrieve. Default is 1000

  • page (int, optional) – The starting page to retrieve. Default is 0.

  • last_updated (date, optional) – A datetime.date object stating when the threshold for the last updated field can be for a plugin.

  • num_pages (int, optional) – The total number of pages to request before stopping the iterator.

Returns:

An iterator that handles the page management of the requested records.

Return type:

PluginsIterator

Examples

Getting the listing of all plugins:

>>> for plugin in tio.plugins.list():
...     pprint(plugin)

Retrieving all of the plugins updated since 2019-01-01:

>>> for plugin in tio.plugins.list(last_updated=date(2019, 1, 1)):
...     pprint(plugin)

Informing the iterator to cache the plugin family data for injection into each item:

>>> plugins = tio.plugins.list(last_updated=date(2019, 1, 1))
>>> plugins.populate_maptable = True
>>> for plugin in plugins:
...     pprint(plugin)
plugin_details(plugin_id)[source]

Retrieve the details for a specific plugin.

plugins: plugin-details

Parameters:

plugin_id (int) – The plugin id for the requested plugin.

Returns:

A dictionary stating the id, name, family, and any other relevant attributes associated to the plugin.

Return type:

dict

Examples

>>> plugin = tio.plugins.plugin_details(19506)
>>> pprint(plugin)