Scanners¶
The following methods allow for interaction into the Tenable Vulnerability Management scanners API.
Methods available on tio.scanners
:
- class ScannersAPI(api: APISession)[source]¶
- allowed_scanners()[source]¶
A simple convenience function that returns the list of scanners that the current user is allowed to use.
- Returns:
List of scanner documents.
- Return type:
Examples
>>> for scanner in tio.scanners.allowed_scanners(): ... pprint(scanner)
- control_scan(scanner_id, scan_uuid, action)[source]¶
Perform actions against scans on a given scanner.
- Parameters:
- Returns:
The action was sent to the scan successfully.
- Return type:
Examples
Stop a scan running on the scanner:
>>> tio.scanners.control_scan(1, '00000000-0000-0000-0000-000000000000', 'stop')
- delete(id)[source]¶
Delete a scanner from Tenable Vulnerability Management.
- Parameters:
id (int) – The unique identifier for the scanner to delete.
- Returns:
The scanner was successfully deleted.
- Return type:
Examples
>>> tio.scanners.delete(1)
- details(id)[source]¶
Retrieve the details for a specified scanner.
- Parameters:
id (int) – The unique identifier for the scanner
- Returns:
The scanner resource record.
- Return type:
Examples
>>> scanner = tio.scanners.details(1) >>> pprint(scanner)
- edit(id, **kwargs)[source]¶
Modify the scanner.
- Parameters:
id (int) – The unique identifier for the scanner.
force_plugin_update (bool, optional) – Force the scanner to perform a plugin update .
force_ui_update (bool, optional) – Force the scanner to perform a UI update.
finish_update (bool, optional) – Force the scanner to reboot to complete the update process. This action is only valid when automatic updates are disabled.
registration_code (str, optional) – Sets the registration code for the scanner.
aws_update_interval (int, optional) – For AWS scanners this will inform the scanner how often to check into Tenable Vulnerability Management.
- Returns:
The operation was requested successfully.
- Return type:
Examples
Force a plugin update on a scanner:
>>> tio.scanners.edit(1, force_plugin_update=True)
- edit_permissions(id, *acls)[source]¶
Modifies the permissions list for the given scanner.
- Parameters:
- Returns:
The permissions have been updated successfully.
- Return type:
Examples
>>> tio.scanners.edit_permissions(1, ... {'type': 'default, 'permissions': 16}, ... {'type': 'user', 'id': 2, 'permissions': 16})
- get_aws_targets(id)[source]¶
Returns the list of AWS targets the scanner can reach.
- Parameters:
id (int) – The unique identifier for the scanner.
- Returns:
List of aws target resource records.
- Return type:
Examples
>>> for target in tio.scanners.get_aws_targets(1): ... pprint(target)
- get_permissions(id)[source]¶
Returns the permission list for a given scanner.
- Parameters:
id (int) – The unique identifier for the scanner.
- Returns:
The permissions resource for the scanner
- Return type:
Examples
>>> tio.scanners.get_permissions(1)
- get_scanner_key(id)[source]¶
Return the key associated with the scanner.
- Parameters:
id (int) – The unique identifier for the scanner.
- Returns:
The scanner key
- Return type:
Examples
>>> print(tio.scanners.get_scanner_key(1))
- get_scans(id)[source]¶
Retrieves the scans associated to the scanner.
- Parameters:
id (int) – The unique identifier for the scanner.
- Returns:
List of scan resource records associated to the scanner.
- Return type:
Examples
>>> for scan in tio.scanners.get_scans(1): ... pprint(scan)
- linking_key()[source]¶
The linking key for the Tenable Vulnerability Management instance.
- Returns:
The linking key
- Return type:
Examples
>>> print(tio.scanners.linking_key())
- list()[source]¶
Retrieves the list of scanners.
- Returns:
List of scanner resource records.
- Return type:
Examples
>>> for scanner in tio.scanners.list(): ... pprint(scanner)