Important

The Nessus Package is currently a Technology Preview

Settings

Methods described in this section relate to the Settings API. These methods can be accessed at Nessus.settings.

class SettingsAPI(api: restfly.session.APISession)[source]
alerts(start_time: Optional[int] = None, end_time: Optional[int] = None) List[Dict][source]

Returns the list of health alerts generated by the scanner

Parameters
  • start_time (int, optional) – Start time to query the historical data for. Defaults to 24hrs ago.

  • end_time (int, optional) – End time to query the historicat data for. Defaults to now.

Returns

List of alert objects matching the specified time range

Return type

List[Dict]

Example

>>> nessus.settings.alerts()
health() Dict[source]

Returns the current health statistics fore the Tenable Nessus scanner

Returns

Health stats information

Return type

Dict

Example

>>> nessus.settings.health()
list() List[Dict][source]

Returns the list of advanced settings

Returns

List of settings objects.

Return type

List[Dict]

Example

>>> nessus.settings.list()
modify(settings: List[Dict]) Dict[source]

Modifies the advanced settings on the Tenable Nessus scanner. Settings objects must contain an action and a name field. They may also require a value field and/or an id field depending on the nature of the change.

Parameters

settings (list[dict]) – List of settings change objects

Examples

Adding a new value:

>>> nessus.settings.modify([{
...     'action': 'add',
...     'name': 'new_value',
...     'value': 'value_contents'
... }])

Updating a default setting value:

>>> nessus.settings.modify([{
...     'action': 'edit',
...     'name': 'allow_post_scan_editing',
...     'value': 'no'
... }])

Removing a setting:

>>> nessus.settings.modify([{
...     'action': 'remove',
...     'name': 'old_setting',
...     'id': 'abcdef1234567890abcdef'
... }])