Editor

The following methods allow for interaction into the Tenable Vulnerability Management editor API endpoints. While these endpoints are pythonized for completeness within pyTenable, the Editor API endpoints should generally be avoided unless absolutely necessary. These endpoints are used to drive the Tenable Vulnerability Management UI, and not designed to be used programmatically.

Methods available on io.editor:

class EditorAPI(api: APISession)[source]
audits(etype, object_id, file_id, fobj=None)[source]

Retrieves an audit file from Tenable Vulnerability Management

editor: audits

Parameters:
  • etype (str) – The type of template to retrieve. Must be either scan or policy.

  • object_od (int) – The unique identifier of the object.

  • file_id (int) – The unique identifier of the file to export.

  • fobj (FileObject) – An optional File-like object to write the file to. If none is provided a BytesIO object will be returned.

Returns:

A File-like object of of the audit file.

Return type:

file

details(etype, id)[source]

Constructs a valid scan document from the specified item.

Important

Please note that the details method is reverse-engineered from the responses from the editor API, and while we are reasonably sure that the response should align almost exactly to what the API expects to be pushed to it, this method by very nature of what it’s doing isn’t guaranteed to always work.

Parameters:
  • etype (str) – The type of object to request.

  • scan_id (int) – The unique identifier for the scan.

Returns:

The constructed scan configuration resource.

Return type:

dict

Examples

>>> policy = tio.editor.details('scan', 1)
>>> pprint(scan)
obj_details(etype, id)[source]

Retrieves details about a specific object.

editor: template-details

Parameters:
  • etype (str) – The type of object to retrieve. Must be either scan or policy.

  • id (int) – The unique identifier of the object.

Returns:

Details of the requested object

Return type:

dict

plugin_description(policy_id, family_id, plugin_id)[source]

Retrieves the plugin description for the specified plugin.

editor: plugin-description

Parameters:
  • policy_id (int) – The identifier of the policy.

  • family_id (int) – The identifier of the plugin family.

  • plugin_id (int) – The identifier of the plugin within the family.

Returns:

Details of the plugin requested.

Return type:

dict

template_details(etype, uuid)[source]

Retrieves details about a specific template.

editor: template-details

Parameters:
  • etype (str) – The type of template to retrieve. Must be either scan or policy.

  • uuid (str) – The UUID (unique identifier) for the template.

Returns:

Details on the requested template

Return type:

dict

template_list(etype)[source]

List template objects.

editor: list

Parameters:

etype (str) – The type of object to retrieve. Must be either scan or policy.

Returns:

Listing of template records.

Return type:

list