Scanner Groups

The following methods allow for interaction into the Tenable Vulnerability Management scanner-groups API endpoints.

Methods available on tio.scanner_groups:

class ScannerGroupsAPI(api: restfly.session.APISession)[source]

This will contain all methods related to scanner groups

add_scanner(group_id, scanner_id)[source]

Add a scanner to a scanner group.

scanner-groups: add-scanner

Parameters
  • group_id (int) – The unique identifier of the scanner group.

  • scanner_id (int) – The unique identifier of the scanner.

Returns

Scanner successfully added to the scanner group.

Return type

None

Examples

>>> tio.scanner_groups.add_scanner(1, 1)
create(name, group_type=None)[source]

Create a scanner group.

scanner-groups: create

Parameters
  • name (str) – The name of the scanner group to create

  • group_type (str, optional) – The type of scanner group to create. Currently the only supported type is “load_balancing”

Returns

The scanner group resource record for the created group.

Return type

dict

Example

>>> group = tio.scanner_groups.create('Scanner Group')
delete(group_id)[source]

Deletes a scanner group.

scanner-groups: delete

Parameters

group_id (int) – The unique identifier for the scanner group to delete.

Returns

The scanner group has been successfully deleted.

Return type

None

Examples

>>> tio.scanner_groups.delete(1)
delete_scanner(group_id, scanner_id)[source]

Removes a scanner from a scanner group.

scanner-groups: delete-scanner

Parameters
  • group_id (int) – The unique identifier of the scanner group.

  • scanner_id (int) – The unique identifier of the scanner to remove from the requested scanner group.

Returns

The scanner was successfully removed from the scanner group.

Return type

None

Examples

>>> tio.scanner_groups.delete_scanner(1, 1)
details(group_id)[source]

Retrieves the details about a scanner group.

scanner-groups: details

Parameters

group_id (int) – The unique identifier for the scanner group.

Returns

The scanner group resource record.

Return type

dict

Examples

>>> group = tio.scanner_groups.details(1)
>>> pprint(group)
edit(group_id, name)[source]

Modifies a scanner group.

scanner-groups: edit

Parameters
  • group_id (int) – The unique identifier for the scanner group.

  • name (str) – The new name for the scanner group.

Returns

The scanner group has been successfully updated.

Return type

None

Examples

>>> tio.scanner_groups.edit(1, 'New Group Name')
edit_routes(group_id, routes)[source]

Updates the hostnames, hostname wildcards, IP addresses, and IP address ranges that Tenable Vulnerability Management matches against targets in auto-routed scans

scanner-groups: edit-routes

Parameters
  • group_id (int) – The unique identifier of the scanner group

  • routes (list) – The list of routes for scanner group

Returns

The scanner group routes has been successfully updated

Return type

None

Examples:
>>> tio.scanner_groups.edit_routes(1, ['127.0.0.1'])

list()[source]

Lists the configured scanner groups.

scanner-groups: list

Returns

List of scanner group resource records.

Return type

list

Examples

>>> for group in tio.scanner_groups.list():
...     pprint(group)
list_routes(group_id)[source]

List the hostnames, wildcards, IP addresses, and IP address ranges that Tenable Vulnerability Management matches against targets in auto-routed scans

scanner-groups: list-routes

Parameters

group_id (int) – The unique identifier of the scanner group

Returns

List of routes associated to the scanner group.

Return type

list

Examples:
>>> for scanner in tio.scanner_groups.list_routes(1):
...     pprint(scanner)

list_scanners(group_id)[source]

List the scanners within a specific scanner group.

devportalscanner-groups: list-scanners scanner-groups-list-scanners>

Parameters

group_id (int) – The unique identifier of the scanner group.

Returns

List of scanner resource records associated to the scanner group.

Return type

list

Examples

>>> for scanner in tio.scanner_groups.list_scanners(1):
...     pprint(scanner)