Important
The Nessus Package is currently a Technology Preview
Editor¶
Methods described in this section relate to the the editor API.
These methods can be accessed at Nessus.editor
.
- class EditorAPI(api: APISession)[source]¶
- details(object_type: Literal['scan', 'policy'], object_id: int) → Dict[source]¶
Returns the object requested.
- Parameters:
- Returns:
The editor object for the requested item.
- Return type:
Dict
Example
>>> nessus.editor.details('scan', 1)
- export_audit(object_type: Literal['scan', 'policy'], object_id: int, file_id: int, **kwargs) → BytesIO[source]¶
Exports the given audit file. from the scan or policy
- Parameters:
object_type (str) – The object type (either scan or policy).
object_id (int) – The id of the object to export from.
file_id (int) – The id of the audit file to export.
fobj (BytexIO, optional) – The file object to write the exported file to. If none is specified then a BytesIO object is written to in memory.
chunk_size (int, optional) – The chunk sizing for the download itself.
stream_hook (callable, optional) – Overload the default downloading behavior with a custom stream hook.
hook_kwargs (dict, optional) – keyword arguments to pass to the stream_hook callable in addition to the default passed params.
- Returns:
The file object of the requested audit file.
- Return type:
BytesIO
Example
>>> with open('example.audit', 'wb') as audit_file: ... nessus.editor.export_audit('policy', 1, 1, fobj=audit_file)
- plugin_description(policy_id: int, family_id: int, plugin_id: int) → Dict[source]¶
Returns the plugin description.
- Parameters:
- Returns:
The plugin description.
- Return type:
Dict
Example
>>> nessus.editor.plugin_description(1, 1, 19506)
- template_details(object_type: Literal['scan', 'policy'], template_uuid: str) → Dict[source]¶
Returns the template object requested.
- Parameters:
- Returns:
The editor object for the requested template.
- Return type:
Dict
Example
>>> nessus.editor.template_details( ... 'scan', '00000000-0000-0000-000000000000')
- template_list(object_type: Literal['scan', 'policy']) → List[Dict][source]¶
Returns the list of template objects.
- Parameters:
object_type (str) – The type of templates to return (either scan or policy).
- Returns:
List of template summaries.
- Return type:
List[Dict]
Example
>>> for tmpl in nessus.editor.template_list('scan'): ... print(tmpl)