Scan Zones

The following methods allow for interaction into the Tenable Security Center Scan Zone API. These items are typically seen under the Scan Zones section of Tenable Security Center.

Methods available on sc.scan_zones:

class ScanZoneAPI(api: restfly.session.APISession)[source]
create(name, **kw)[source]

Creates a scan zone.

scan-zone: create

Parameters
  • name (str) – The name of the scan zone

  • description (str, optional) – A description for the scan zone.

  • ips (list, optional) – The list of IP addresses, CIDRs, or IP ranges that encompass the scan zone.

  • scanner_ids (list, optional) – A list of scanner ids to associate to the scan zone.

Returns

The newly created scan zone.

Return type

dict

Examples

>>> zone = sc.scan_zones.create('Example Scan Zone',
...     ips=['127.0.0.1'], scanner_ids=[1])
delete(id)[source]

Removes the specified scan zone.

scan-zone: delete

Parameters

id (int) – The numeric identifier for the scan-zone to remove.

Returns

An empty response.

Return type

str

Examples

>>> sc.scan_zones.delete(1)
details(id, fields=None)[source]

Returns the details for a specific scan zone.

scan-zone: details

Parameters
  • id (int) – The identifier for the scan.

  • fields (list, optional) – A list of attributes to return.

Returns

The scan zone resource record.

Return type

dict

Examples

>>> zone = sc.scan_zones.details(1)
>>> pprint(zone)
edit(id, **kw)[source]

Edits a scan zone.

scan-zone: edit

Parameters
  • description (str, optional) – A description for the scan zone.

  • ips (list, optional) – The list of IP addresses, CIDRs, or IP ranges that encompass the scan zone.

  • name (str, optional) – The name of the scan zone

  • scanner_ids (list, optional) – A list of scanner ids to associate to the scan zone.

Returns

The newly updated scan zone.

Return type

dict

Examples

>>> zone = sc.scan_zones.create(1,
...     ips=['127.0.0.1'], scanner_ids=[1])
list(fields=None)[source]

Retrieves the list of scan zone definitions.

scan-zone: list

Parameters

fields (list, optional) – A list of attributes to return for each scan.

Returns

A list of scan zone resources.

Return type

list

Examples

>>> for zone in sc.scan_zones.list():
...     pprint(zone)