Scanners¶
The following methods allow for interaction into the Tenable Security Center Scanner API. These items are typically seen under the Scanners section of Tenable Security Center.
Methods available on sc.scanners
:
- class ScannerAPI(api: APISession)[source]¶
- agent_scans(id, search, results=None)[source]¶
Retrieves the list of agent scans that meed the specified search criteria.
- Parameters:
- Returns:
The list of scans that match the search criteria.
- Return type:
Examples
>>> scans = sc.scanners.agent_scans('*')
- create(name, address, **kw)[source]¶
Creates a scanner.
- Parameters:
address (str) – The address of the scanner
name (str) – The name of the scanner
agent_capable (bool, optional) – Is this scanner an agent capable scanner? If left unspecified the default is
False
.description (str, optional) – The description of the scanner.
enabled (bool, optional) – Is this scanner enabled? If left unspecified, the default is
True
.managed (bool, optional) – Is the plugin set for this scanner managed? If left unspecified then the default is
False
.orgs (list, optional) – If the scanner is an agent capable scanner, then a list of organization ids is to be specified to attach the scanner for the purposes of agent scanning.
port (int, optional) – What is the port that the Nessus service is running on. If left unspecified, then the default is
8834
.proxy (bool, optional) – Is this scanner behind a proxy? If left unspecified then the default is
False
.zone_ids (list, optional) – List of scan zones that this scanner is to be a member of.
- Returns:
The newly created scanner.
- Return type:
Examples
>>> scanner = sc.scanners.create('Example Scanner', '192.168.0.1')
- delete(id)[source]¶
Removes the specified scanner.
- Parameters:
id (int) – The numeric identifier for the scanner to remove.
- Returns:
An empty response.
- Return type:
Examples
>>> sc.scanners.delete(1)
- details(id, fields=None)[source]¶
Returns the details for a specific scanner.
- Parameters:
- Returns:
The scanner resource record.
- Return type:
Examples
>>> scanner = sc.scanners.details(1) >>> pprint(scanner)
- edit(id, **kw)[source]¶
Edits a scanner.
- Parameters:
id (int) – The numeric identifier for the scanner.
address (str, optional) – The address of the scanner
agent_capable (bool, optional) – Is this scanner an agent capable scanner? If left unspecified the default is
False
.description (str, optional) – The description of the scanner.
enabled (bool, optional) – Is this scanner enabled? If left unspecified, the default is
True
.managed (bool, optional) – Is the plugin set for this scanner managed? If left unspecified then the default is
False
.name (str, optional) – The name of the scanner
orgs (list, optional) – If the scanner is an agent capable scanner, then a list of organization ids is to be specified to attach the scanner for the purposes of agent scanning.
port (int, optional) – What is the port that the Nessus service is running on. If left unspecified, then the default is
8834
.proxy (bool, optional) – Is this scanner behind a proxy? If left unspecified then the default is
False
.zone_ids (list, optional) – List of scan zones that this scanner is to be a member of.
- Returns:
The newly updated scanner.
- Return type:
Examples
>>> scanner = sc.scanners.edit(1, enabled=True)
- list(fields=None)[source]¶
Retrieves the list of scanner definitions.
- Parameters:
fields (list, optional) – A list of attributes to return for each scanner.
- Returns:
A list of scanner resources.
- Return type:
Examples
>>> for scanner in sc.scanners.list(): ... pprint(scanner)