tenable_io.api package¶
Submodules¶
tenable_io.api.agent_groups module¶
-
class
tenable_io.api.agent_groups.AgentGroupSaveRequest(name)¶
-
class
tenable_io.api.agent_groups.AgentGroupsApi(client)¶ Bases:
tenable_io.api.base.BaseApi-
add_agent(agent_group_id, agent_id)¶ Add an agent to the given agent group.
Parameters: - agent_group_id – The agent group ID.
- agent_id – The agent ID.
Raises: TenableIOApiException – When API error is encountered.
Returns: True if successful.
-
agents(agent_group_id, offset=None, limit=None)¶ Get agent list for given agent group.
Parameters: - agent_group_id – The agent group ID.
- offset – The starting record to retrieve, defaults to 0 if not defined.
- limit – The number of records to retrieve, API will defaults to 50 if not defined.
Raises: TenableIOApiException – When API error is encountered.
Returns: An instance of
tenable_io.api.models.AgentList.
-
configure(agent_group_id, configure_agent_group)¶ Configure name of give agent group.
Parameters: - agent_group_id – The agent group ID.
- configure_agent_group – An instance of
AgentGroupSaveRequest.
Raises: TenableIOApiException – When API error is encountered.
Returns: True if successful.
-
create(create_agent_group)¶ Create an agent group.
Parameters: create_agent_group – An instance of AgentGroupSaveRequest.Raises: TenableIOApiException – When API error is encountered. Returns: The ID of agent group just created.
-
delete(agent_group_id)¶ Delete an agent group.
Parameters: agent_group_id – The agent group ID. Raises: TenableIOApiException – When API error is encountered. Returns: True if successful.
-
delete_agent(agent_group_id, agent_id)¶ Delete an agent from the given agent group.
Parameters: - agent_group_id – The agent group ID.
- agent_id – The agent ID.
Raises: TenableIOApiException – When API error is encountered.
Returns: True if successful.
-
details(agent_group_id, offset=None, limit=None)¶ Get details of given agent group.
Parameters: - agent_group_id – The agent group ID.
- offset – The starting record to retrieve, defaults to 0 if not defined.
- limit – The number of records to retrieve, API will defaults to 50 if not defined.
Raises: TenableIOApiException – When API error is encountered.
Returns: An instance of
tenable_io.api.models.AgentGroup.
-
list()¶ Return agent groups for the given scanner.
Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.AgentGroupList.
-
tenable_io.api.agents module¶
-
class
tenable_io.api.agents.AgentsApi(client)¶ Bases:
tenable_io.api.base.BaseApi-
delete(agent_id)¶ Deletes the given agent.
Parameters: agent_id – The Agent ID. Raises: TenableIOApiException – When API error is encountered. Returns: True if successful.
-
list(offset=None, limit=None)¶ Lists agents for the given scanner.
Parameters: - offset – The starting record to retrieve, defaults to 0 if not defined.
- limit – The number of records to retrieve, API will defaults to 50 if not defined.
Raises: TenableIOApiException – When API error is encountered.
Returns: An instance of
tenable_io.api.models.AgentList.
-
tenable_io.api.editor module¶
-
class
tenable_io.api.editor.EditorApi(client)¶ Bases:
tenable_io.api.base.BaseApi-
list(type)¶ Returns the template list.
Parameters: type – The type of template (scan or policy). Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.TemplateList.
-
tenable_io.api.exclusions module¶
-
class
tenable_io.api.exclusions.ExclusionApi(client)¶ Bases:
tenable_io.api.base.BaseApi-
create(exclusion_create)¶ Create a new exclusion
Parameters: exclusion_create – An instance of ExclusionCreateRequest.Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.Exclusion.
-
delete(list_id)¶ Delete an exclusion
Parameters: list_id – The exclusion ID. Raises: TenableIOApiException – When API error is encountered. Returns: True if successful.
-
details(list_id)¶ Return details of given exclusion
Parameters: list_id – The exclusion ID. Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.Exclusion.
-
edit(list_id, exclusion_edit)¶ Edit the given exclusion
Parameters: - list_id – The exclusion ID.
- exclusion_edit – An instance of
ExclusionEditRequest.
Raises: TenableIOApiException – When API error is encountered.
Returns: An instance of
tenable_io.api.models.Exclusion.
-
list()¶ Return the current exclusions
Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.ExclusionList.
-
-
class
tenable_io.api.exclusions.ExclusionCreateRequest(name, members, description=None, schedule=None)¶
-
class
tenable_io.api.exclusions.ExclusionEditRequest(name=None, members=None, description=None, schedule=None)¶
-
class
tenable_io.api.exclusions.ExclusionSaveBaseRequest(name, members=None, description=None, schedule=None)¶ Bases:
tenable_io.api.base.BaseRequest-
as_payload(filter_=None)¶
-
tenable_io.api.file module¶
-
class
tenable_io.api.file.FileApi(client)¶ Bases:
tenable_io.api.base.BaseApi-
upload(file)¶ Upload a file
Parameters: file – An instance of file object Raises: TenableIOApiException – When API error is encountered. Returns: The name of the uploaded file.
-
tenable_io.api.folders module¶
-
class
tenable_io.api.folders.FoldersApi(client)¶ Bases:
tenable_io.api.base.BaseApi-
create(name)¶ Create a new folder for the current user.
Parameters: name – The folder name. Raises: TenableIOApiException – When API error is encountered. Returns: The ID of the folder created.
-
delete(folder_id)¶ Delete the folder.
Parameters: folder_id – The folder ID. Raises: TenableIOApiException – When API error is encountered. Returns: True if successful.
-
edit(folder_id, name)¶ Rename the folder.
Parameters: - folder_id – The folder ID.
- name – The folder name to be renamed.
Raises: TenableIOApiException – When API error is encountered.
Returns: True if successful.
-
list()¶ Returns the current user’s scan folders.
Raises: TenableIOApiException – When API error is encountered. Returns: An instance of :class”tenable_io.api.models.FolderList.
-
tenable_io.api.groups module¶
-
class
tenable_io.api.groups.GroupsApi(client)¶ Bases:
tenable_io.api.base.BaseApi-
add_user(group_id, user_id)¶ Add a user to the group.
Parameters: - group_id – The group ID.
- user_id – The user ID.
Raises: TenableIOApiException – When API error is encountered.
Returns: True if successful.
-
create(name)¶ Create a group.
Parameters: name – The group name. Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.Group.
-
delete(group_id)¶ Delete a group.
Parameters: group_id – The group ID. Raises: TenableIOApiException – When API error is encountered. Returns: True if successful.
-
delete_user(group_id, user_id)¶ Delete a user from the group.
Parameters: - group_id – The group ID.
- user_id – The user ID.
Raises: TenableIOApiException – When API error is encountered.
Returns: True if successful.
-
edit(group_id, name)¶ Edit a group.
Parameters: - group_id – The group ID.
- name – The group name.
Returns: True if successful.
-
list()¶ Return the group list.
Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.Grouplist.
-
list_users(group_id)¶ Return the user list in the group.
Parameters: group_id – The group ID. Returns: An instance of tenable_io.api.models.UserList.
-
tenable_io.api.models module¶
-
class
tenable_io.api.models.Agent(distro=None, id=None, ip=None, last_scanned=None, name=None, platform=None, token=None, uuid=None, linked_on=None, last_connect=None, plugin_feed_id=None, core_build=None, core_version=None, groups=None, status=None)¶
-
class
tenable_io.api.models.AgentGroup(id=None, name=None, owner_id=None, owner=None, owner_name=None, owner_uuid=None, shared=None, user_permissions=None, creation_date=None, last_modification_date=None, agents=None, uuid=None, pagination=None)¶
-
class
tenable_io.api.models.AgentGroupList(groups=None)¶ Bases:
tenable_io.api.models.BaseModel-
groups¶
-
-
class
tenable_io.api.models.AgentList(agents=None, pagination=None)¶ Bases:
tenable_io.api.models.BaseModel-
agents¶
-
-
class
tenable_io.api.models.Asset(id=None, fqdn=None, ipv4=None, ipv6=None, last_seen=None, operating_system=None, severities=None)¶ Bases:
tenable_io.api.models.BaseModel-
severities¶
-
-
class
tenable_io.api.models.AssetActivity(type=None, timestamp=None, scan_id=None, schedule_id=None, source=None, matches=None)¶
-
class
tenable_io.api.models.AssetActivityList(activity=None)¶ Bases:
tenable_io.api.models.BaseModel-
activity¶
-
-
class
tenable_io.api.models.AssetInfo(counts=None, first_seen=None, fqdn=None, ipv4=None, ipv6=None, last_authenticated_scan_date=None, last_seen=None, mac_address=None, netbios_name=None, operating_system=None, system_type=None)¶ Bases:
tenable_io.api.models.BaseModel-
counts¶
-
-
class
tenable_io.api.models.AssetList(assets=None)¶ Bases:
tenable_io.api.models.BaseModel-
assets¶
-
-
class
tenable_io.api.models.AssetSeverity(count=None, level=None, name=None)¶
-
class
tenable_io.api.models.BaseModel¶ Bases:
object-
as_payload(filter_=None)¶
-
classmethod
from_dict(dict_)¶
-
classmethod
from_json(json)¶
-
classmethod
from_json_list(json_list)¶
-
classmethod
from_list(list_)¶
-
-
class
tenable_io.api.models.Exclusion(id=None, name=None, description=None, schedule=None, creation_date=None, last_modification_date=None, members=None)¶ Bases:
tenable_io.api.models.BaseModel-
schedule¶
-
-
class
tenable_io.api.models.ExclusionList(exclusions=None)¶ Bases:
tenable_io.api.models.BaseModel-
exclusions¶
-
-
class
tenable_io.api.models.ExclusionRrules(freq=None, interval=None, byweekday=None, bymonthday=None)¶
-
class
tenable_io.api.models.ExclusionSchedule(enabled=None, starttime=None, endtime=None, timezone=None, rrules=None)¶ Bases:
tenable_io.api.models.BaseModel-
as_payload(filter_=None)¶
-
rrules¶
-
-
class
tenable_io.api.models.Folder(id=None, name=None, type=None, default_tag=None, custom=None, unread_count=None)¶ Bases:
tenable_io.api.models.BaseModel-
TYPE_CUSTOM= 'custom'¶
-
TYPE_MAIN= 'main'¶
-
TYPE_TRASH= 'trash'¶
-
-
class
tenable_io.api.models.FolderList(folders=None)¶ Bases:
tenable_io.api.models.BaseModel-
folders¶
-
-
class
tenable_io.api.models.Group(id=None, name=None, permissions=None, user_count=None)¶
-
class
tenable_io.api.models.GroupList(groups=None)¶ Bases:
tenable_io.api.models.BaseModel-
groups¶
-
-
class
tenable_io.api.models.Plugin(id=None, name=None)¶
-
class
tenable_io.api.models.PluginAttribute(attribute_name=None, attribute_value=None)¶
-
class
tenable_io.api.models.PluginDetails(id=None, name=None, family_name=None, attributes=None)¶ Bases:
tenable_io.api.models.BaseModel-
attributes¶
-
-
class
tenable_io.api.models.PluginFamily(id=None, name=None, count=None)¶
-
class
tenable_io.api.models.PluginFamilyDetails(id=None, name=None, plugins=None)¶ Bases:
tenable_io.api.models.BaseModel-
plugins¶
-
-
class
tenable_io.api.models.PluginFamilyList(families=None)¶ Bases:
tenable_io.api.models.BaseModel-
families¶
-
-
class
tenable_io.api.models.Policy(id=None, template_uuid=None, name=None, description=None, owner_id=None, owner=None, shared=None, user_permissions=None, creation_date=None, last_modification_date=None, visibility=None, no_target=None)¶
-
class
tenable_io.api.models.PolicyAudits(custom=None, feed=None)¶
-
class
tenable_io.api.models.PolicyAuditsCustom(add=None, delete=None, edit=None)¶
-
class
tenable_io.api.models.PolicyAuditsCustomItem(category=None, file=None)¶
-
class
tenable_io.api.models.PolicyAuditsFeed(add=None, delete=None, edit=None)¶
-
class
tenable_io.api.models.PolicyAuditsFeedItem(id=None, variables=None)¶
-
class
tenable_io.api.models.PolicyCredentials(add=None, delete=None, edit=None)¶
-
class
tenable_io.api.models.PolicyDetails(uuid=None, audits=None, credentials=None, plugins=None, scap=None, settings=None)¶ Bases:
tenable_io.api.models.BaseModel-
settings¶
-
-
class
tenable_io.api.models.PolicyList(policies=None)¶ Bases:
tenable_io.api.models.BaseModel-
policies¶
-
-
class
tenable_io.api.models.PolicySCAP(add=None, delete=None, edit=None)¶
-
class
tenable_io.api.models.PolicySettings(acls=[], additional_snmp_port1=None, additional_snmp_port2=None, additional_snmp_port3=None, adtran_aos_offline_configs=None, allow_post_scan_editing=None, apm_force_updates=None, apm_update_timeout=None, arp_ping=None, av_grace_period=None, aws_ap_northeast_1=None, aws_ap_southeast_1=None, aws_ap_southeast_2=None, aws_eu_west_1=None, aws_sa_east_1=None, aws_ui_region_type=None, aws_us_east_1=None, aws_us_gov_west_1=None, aws_us_west_1=None, aws_us_west_2=None, aws_use_https=None, aws_verify_ssl=None, brocade_offline_configs=None, check_crl=None, cisco_config_to_audit=None, cisco_offline_configs=None, dell_f10_offline_configs=None, description=None, detect_ssl=None, display_unreachable_hosts=None, dont_use_ntlmv1=None, enable_admin_shares=None, enum_domain_users_end_uid=None, enum_domain_users_start_uid=None, enum_local_users_end_uid=None, enum_local_users_start_uid=None, enumerate_all_ciphers=None, extremeos_offline_configs=None, fast_network_discovery=None, fireeye_offline_configs=None, host_whitelist=None, http_login_auth_regex_nocase=None, http_login_auth_regex_on_headers=None, http_login_invert_auth_regex=None, http_login_max_redir=None, http_login_method=None, huawei_offline_configs=None, icmp_ping=None, icmp_ping_retries=None, icmp_unreach_means_host_down=None, junos_offline_configs=None, log_live_hosts=None, log_whole_attack=None, max_checks_per_host=None, max_hosts_per_scan=None, max_simult_tcp_sessions_per_host=None, max_simult_tcp_sessions_per_scan=None, modbus_end_reg=None, modbus_start_reg=None, name=None, netapp_offline_configs=None, network_receive_timeout=None, network_type=None, never_send_win_creds_in_the_clear=None, only_portscan_if_enum_failed=None, patch_audit_over_rexec=None, patch_audit_over_rsh=None, patch_audit_over_telnet=None, ping_the_remote_host=None, portscan_range=None, procurve_config_to_audit=None, procurve_offline_configs=None, provided_creds_only=None, reduce_connections_on_congestion=None, report_paranoia=None, report_superseded_patches=None, report_verbosity=None, request_windows_domain_info=None, reverse_lookup=None, safe_checks=None, scan_netware_hosts=None, scan_network_printers=None, scan_webapps=None, silent_dependencies=None, slice_network_addresses=None, smtp_domain=None, smtp_from=None, smtp_to=None, snmp_port=None, snmp_scanner=None, sonicos_offline_configs=None, ssh_client_banner=None, ssh_known_hosts=None, ssh_netstat_scanner=None, ssh_port=None, ssl_prob_ports=None, start_cotp_tsap=None, start_remote_registry=None, stop_cotp_tsap=None, stop_scan_on_disconnect=None, svc_detection_on_all_ports=None, syn_firewall_detection=None, syn_scanner=None, tcp_firewall_detection=None, tcp_ping=None, tcp_ping_dest_ports=None, tcp_scanner=None, test_default_oracle_accounts=None, test_local_nessus_host=None, thorough_tests=None, udp_ping=None, udp_scanner=None, unscanned_closed=None, verify_open_ports=None, win_known_bad_hashes=None, win_known_good_hashes=None, wmi_netstat_scanner=None, wol_mac_addresses=None, wol_wait_time=None)¶
-
class
tenable_io.api.models.ScContainer(number_of_vulnerabilities=None, name=None, digest=None, score=None, id=None, status=None, created_at=None, platform=None, updated_at=None)¶
-
class
tenable_io.api.models.ScReport(id=None, image_name=None, docker_image_id=None, tag=None, os=None, os_version=None, os_architecture=None, sha256=None, sha1=None, md5=None, platform=None, created_at=None, updated_at=None, malware=None, findings=None, installed_packages=None, risk_score=None, digest=None)¶
-
class
tenable_io.api.models.ScTestJob(container_id=None, job_id=None, error=None, job_status=None, created_at=None, updated_at=None)¶
-
class
tenable_io.api.models.Scan(id=None, uuid=None, name=None, type=None, owner=None, enabled=None, folder_id=None, read=None, status=None, shared=None, user_permissions=None, creation_date=None, last_modification_date=None, control=None, starttime=None, timezone=None, rrules=None)¶ Bases:
tenable_io.api.models.BaseModel-
STATUS_ABORTED= u'aborted'¶
-
STATUS_CANCELED= u'canceled'¶
-
STATUS_COMPLETED= u'completed'¶
-
STATUS_EMPTY= u'empty'¶
-
STATUS_IMPORTED= u'imported'¶
-
STATUS_PAUSED= u'paused'¶
-
STATUS_PAUSING= u'pausing'¶
-
STATUS_PENDING= u'pending'¶
-
STATUS_RESUMING= u'resuming'¶
-
STATUS_RUNNING= u'running'¶
-
STATUS_STOPPING= u'stopping'¶
-
-
class
tenable_io.api.models.ScanDetails(info=None, hosts=None, comphosts=None, notes=None, remediations=None, vulnerabilities=None, compliance=None, history=None, filters=None)¶ Bases:
tenable_io.api.models.BaseModel-
history¶
-
hosts¶
-
info¶
-
-
class
tenable_io.api.models.ScanDetailsHistory(history_id=None, uuid=None, owner_id=None, status=None, creation_date=None, last_modification_date=None)¶
-
class
tenable_io.api.models.ScanHistory(name=None, object_id=None, owner=None, owner_id=None, owner_uuid=None, scan_end=None, scan_start=None, scan_type=None, schedule_uuid=None, status=None, targets=None, uuid=None)¶
-
class
tenable_io.api.models.ScanHost(host_id=None, host_index=None, hostname=None, progress=None, critical=None, high=None, medium=None, low=None, info=None, totalchecksconsidered=None, numchecksconsidered=None, scanprogresstotal=None, scanprogresscurrent=None, score=None)¶
-
class
tenable_io.api.models.ScanHostCompliance(host_id=None, hostname=None, plugin_id=None, plugin_name=None, plugin_family=None, count=None, severity_index=None, severity=None)¶
-
class
tenable_io.api.models.ScanHostDetails(info=None, vulnerabilities=None, compliance=None)¶ Bases:
tenable_io.api.models.BaseModel-
compliance¶
-
info¶
-
vulnerabilities¶
-
-
class
tenable_io.api.models.ScanHostInfo(host_start=None, mac_address=None, host_fqdn=None, host_end=None, operating_system=None, host_ip=None)¶
-
class
tenable_io.api.models.ScanHostVulnerability(host_id=None, hostname=None, plugin_id=None, plugin_name=None, plugin_family=None, count=None, vuln_index=None, severity_index=None, severity=None)¶
-
class
tenable_io.api.models.ScanInfo(acls=None, edit_allowed=None, status=None, policy=None, pci_can_upload=None, hasaudittrail=None, scan_start=None, folder_id=None, targets=None, timestamp=None, object_id=None, scanner_name=None, haskb=None, uuid=None, hostcount=None, scan_end=None, name=None, user_permissions=None, control=None)¶ Bases:
tenable_io.api.models.BaseModel-
as_payload(filter_=None)¶
-
classmethod
from_dict(dict_)¶
-
-
class
tenable_io.api.models.ScanList(folders=None, scans=None, timestamp=None)¶ Bases:
tenable_io.api.models.BaseModel-
scans¶
-
-
class
tenable_io.api.models.ScanSettings(name, text_targets, description=None, emails=None, enabled=False, launch=None, folder_id=None, policy_id=None, scanner_id=None)¶
-
class
tenable_io.api.models.Scanner(id=None, uuid=None, name=None, type=None, status=None, scan_count=None, engine_version=None, platform=None, loaded_plugin_set=None, registration_code=None, owner=None, key=None, license=None)¶ Bases:
tenable_io.api.models.BaseModel-
license¶
-
-
class
tenable_io.api.models.ScannerAwsTarget(scanner_id=None, instance_id=None, private_ip=None, public_ip=None, state=None, zone=None, type=None, name=None)¶
-
class
tenable_io.api.models.ScannerAwsTargetList(aws_targets=None)¶ Bases:
tenable_io.api.models.BaseModel-
aws_targets¶
-
-
class
tenable_io.api.models.ScannerLicense(type=None, ips=None, agents=None, scanners=None)¶
-
class
tenable_io.api.models.ScannerList(scanners=None)¶ Bases:
tenable_io.api.models.BaseModel-
scanners¶
-
-
class
tenable_io.api.models.ScannerScan(scanner_uuid=None, name=None, status=None, id=None, scan_id=None, user=None, last_modification_date=None, start_time=None, remote=None)¶
-
class
tenable_io.api.models.ScannerScanList(scans=None)¶ Bases:
tenable_io.api.models.BaseModel-
scans¶
-
-
class
tenable_io.api.models.ServerProperties(capabilities=None, enterprise=None, expiration=None, expiration_time=None, idle_timeout=None, license=None, loaded_plugin_set=None, login_banner=None, nessus_type=None, nessus_ui_version=None, notifications=None, plugin_set=None, scanner_boottime=None, server_version=None, server_uuid=None, update=None)¶
-
class
tenable_io.api.models.ServerStatus(status=None, progress=None)¶
-
class
tenable_io.api.models.Session(id=None, username=None, email=None, name=None, type=None, permissions=None, lastlogin=None, container_id=None, groups=None)¶
-
class
tenable_io.api.models.TargetGroup(id=None, default_group=None, name=None, members=None, type=None, owner=None, owner_id=None, last_modification_date=None, shared=None, user_permissions=None)¶
-
class
tenable_io.api.models.TargetGroupList(target_groups=None)¶ Bases:
tenable_io.api.models.BaseModel-
target_groups¶
-
-
class
tenable_io.api.models.Template(uuid=None, name=None, title=None, description=None, cloud_only=None, subscription_only=None, is_agent=None, more_info=None)¶
-
class
tenable_io.api.models.TemplateList(templates=None)¶ Bases:
tenable_io.api.models.BaseModel-
templates¶
-
-
class
tenable_io.api.models.User(id=None, username=None, name=None, email=None, permissions=None, lastlogin=None, type=None, login_fail_count=None, last_login_attempt=None)¶
-
class
tenable_io.api.models.UserKeys(access_key=None, secret_key=None)¶ Bases:
tenable_io.api.models.BaseModel-
as_payload(filter_=None)¶
-
classmethod
from_dict(dict_)¶
-
-
class
tenable_io.api.models.UserList(users=None)¶ Bases:
tenable_io.api.models.BaseModel-
users¶
-
-
class
tenable_io.api.models.Vulnerability¶
-
class
tenable_io.api.models.VulnerabilityList(vulnerabilities=None)¶ Bases:
tenable_io.api.models.BaseModel-
vulnerabilities¶
-
-
class
tenable_io.api.models.VulnerabilityOutput(application_protocol=None, assets=None, port=None, transport_protocol=None)¶
-
class
tenable_io.api.models.VulnerabilityOutputList(outputs=None)¶ Bases:
tenable_io.api.models.BaseModel-
outputs¶
-
-
class
tenable_io.api.models.VulnerabilityPluginOutput(plugin_output=None, states=None)¶ Bases:
tenable_io.api.models.BaseModel-
states¶
-
-
class
tenable_io.api.models.VulnerabilityPluginOutputState(name=None, results=None)¶ Bases:
tenable_io.api.models.BaseModel-
results¶
-
tenable_io.api.plugins module¶
-
class
tenable_io.api.plugins.PluginsApi(client)¶ Bases:
tenable_io.api.base.BaseApi-
families()¶ Return list of plugin families.
Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.PluginFamilyList.
-
family_details(family_id)¶ Return plugin family details.
Parameters: family_id – Plugin family ID. Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.PluginFamilyDetails.
-
plugin_details(plugin_id)¶ Return plugin details.
Parameters: plugin_id – Plugin ID. Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.PluginDetails.
-
tenable_io.api.policies module¶
-
class
tenable_io.api.policies.PoliciesApi(client)¶ Bases:
tenable_io.api.base.BaseApi-
configure(policy_id, policy_configure_request)¶ Update a policy.
Parameters: - policy_id – Policy id.
- policy_configure_request – An instance of
PolicyConfigureRequest.
Raises: TenableIOApiException – When API error is encountered.
Returns: True if successful.
-
copy(policy_id)¶ Copy a policy.
Parameters: policy_id – Policy id. Raises: TenableIOApiException – When API error is encountered. Returns: Policy id.
-
create(policy_create_request)¶ Create a policy.
Parameters: policy_create_request – An instance of PolicyCreateRequest.Raises: TenableIOApiException – When API error is encountered. Returns: Policy id.
-
delete(policy_id)¶ Delete a policy.
Parameters: policy_id – Policy id. Raises: TenableIOApiException – When API error is encountered. Returns: True if successful.
-
details(policy_id)¶ Get policy details.
Parameters: policy_id – Policy id. Raises: TenableIOApiException – When API error is encountered. Returns: An instance of PolicyDetails.
-
export(policy_id, stream=True, chunk_size=1024)¶ Export a policy.
Parameters: - policy_id – Policy id.
- stream – Defaults to True. If False, the response content will be immediately downloaded.
- chunk_size – If Stream=False, data is returned as a single chunk.
Raises: TenableIOApiException – When API error is encountered.
Returns: Response content iterator.
-
import_policy(policy_import_request)¶ Import a policy.
Parameters: policy_import_request – An instance of PolicyImportRequest.Raises: TenableIOApiException – When API error is encountered. Returns: Policy id.
-
list()¶ Return the policy list.
Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.PolicyList.
-
-
class
tenable_io.api.policies.PolicyConfigureRequest(uuid, settings, audits=None, credentials=None, plugins=None, scap=None)¶
-
class
tenable_io.api.policies.PolicyCreateRequest(uuid, settings, audits=None, credentials=None, plugins=None, scap=None)¶ Bases:
tenable_io.api.base.BaseRequest-
as_payload(filter_=None)¶
-
-
class
tenable_io.api.policies.PolicyImportRequest(file)¶
tenable_io.api.scanners module¶
-
class
tenable_io.api.scanners.ScannerControlRequest(action)¶ Bases:
tenable_io.api.base.BaseRequest-
ACTION_PAUSE= u'pause'¶
-
ACTION_RESUME= u'resume'¶
-
ACTION_STOP= u'stop'¶
-
-
class
tenable_io.api.scanners.ScannerEditRequest(force_plugin_update=None, force_ui_update=None, finish_update=None, registration_code=None, aws_update_interval=None)¶
-
class
tenable_io.api.scanners.ScannerToggleRequest(link)¶ Bases:
tenable_io.api.base.BaseRequest-
LINK_DISABLE= 0¶
-
LINK_ENABLE= 1¶
-
-
class
tenable_io.api.scanners.ScannersApi(client)¶ Bases:
tenable_io.api.base.BaseApi-
control_scans(scanner_id, scan_uuid, control_scan)¶ Pause, stop, or resume scan that is active on the scanner.
Parameters: - scanner_id – The scanner ID.
- scan_uuid – The scan UUID.
- control_scan – An instance of
ScannerControlRequest.
Raises: TenableIOApiException – When API error is encountered.
Returns: True if successful.
-
delete(scanner_id)¶ Deletes a scanner.
Parameters: scanner_id – The scanner ID. Raises: TenableIOApiException – When API error is encountered. Returns: True if successful.
-
details(scanner_id)¶ Returns details of a given scanner.
Parameters: scanner_id – The scanner ID. Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.Scanner.
-
edit(scanner_id, scanner_edit)¶ Edit the given scanner.
Parameters: - scanner_id – The scanner ID.
- scanner_edit – An instance of
ScannerEditRequest.
Raises: TenableIOApiException – When API error is encountered.
Returns: True if successful.
-
get_aws_targets(scanner_id)¶ Returns list of AWS scan targets of an AWS scanner.
Parameters: scanner_id – The scanner ID. Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.ScannerAwsTargetList.
-
get_scanner_key(scanner_id)¶ Returns key of given scanner.
Parameters: scanner_id – The scanner ID. Raises: TenableIOApiException – When API error is encountered. Returns: Scanner key.
-
get_scans(scanner_id)¶ Returns list of running scans on given scanner.
Parameters: scanner_id – The scanner ID. Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.ScannerScanList.
-
list()¶ Returns list of scanners.
Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.ScannerList.
-
toggle_link_state(scanner_id, toggle_link)¶ Enables or disables link state of given scanner.
Parameters: - scanner_id – The scanner ID.
- toggle_link – An instance of
ScannerToggleRequest.
Raises: TenableIOApiException – When API error is encountered.
Returns: True if successful.
-
tenable_io.api.scans module¶
-
class
tenable_io.api.scans.ScanConfigureRequest(uuid=None, settings=None)¶
-
class
tenable_io.api.scans.ScanCreateRequest(uuid, settings=None)¶
-
class
tenable_io.api.scans.ScanExportRequest(format, password=None, chapters=None)¶ Bases:
tenable_io.api.base.BaseRequest-
CHAPTER_CUSTOM_VULN_BY_HOST= u'vuln_by_host'¶
-
CHAPTER_CUSTOM_VULN_BY_PLUGIN= u'vuln_by_plugin'¶
-
CHAPTER_EXECUTIVE_SUMMARY= u'vuln_hosts_summary'¶
-
FORMAT_CSV= u'csv'¶
-
FORMAT_DB= u'db'¶
-
FORMAT_HTML= u'html'¶
-
FORMAT_NESSUS= u'nessus'¶
-
FORMAT_PDF= u'pdf'¶
-
as_payload(filter_=None)¶
-
-
class
tenable_io.api.scans.ScanImportRequest(file, folder_id=None, password=None)¶
-
class
tenable_io.api.scans.ScanLaunchRequest(alt_targets=None)¶
-
class
tenable_io.api.scans.ScanSaveRequest(uuid, settings)¶ Bases:
tenable_io.api.base.BaseRequest-
as_payload(filter_=None)¶
-
-
class
tenable_io.api.scans.ScansApi(client)¶ Bases:
tenable_io.api.base.BaseApi-
STATUS_EXPORT_READY= u'ready'¶
-
configure(scan_id, scan_configure)¶ Configure an existing scan.
Parameters: - scan_id –
- scan_configure – An instance of
ScanConfigureRequest.
Raises: TenableIOApiException – When API error is encountered.
Returns: The ID of scan just configured.
-
copy(scan_id)¶
-
create(scan_create)¶ Create a scan.
Parameters: scan_create – An instance of ScanCreateRequest.Raises: TenableIOApiException – When API error is encountered. Returns: The ID of scan just created.
-
delete(scan_id)¶ Delete a scan. NOTE: Scans in running, paused or stopping states can not be deleted.
Raises: TenableIOApiException – When API error is encountered. Parameters: scan_id – The scan ID. Returns: True if successful.
-
details(scan_id, history_id=None)¶ Return details of the given scan.
Parameters: - scan_id – The scan ID.
- history_id – The historical data ID.
Raises: TenableIOApiException – When API error is encountered.
Returns: An instance of
tenable_io.api.models.ScanDetails.
-
export_download(scan_id, file_id, stream=True, chunk_size=1024)¶ Download an exported scan.
Parameters: - scan_id – The scan ID.
- file_id – The file ID.
- stream – Default to True. If False, the response content will be immediately downloaded.
- chunk_size – If Stream=False, data is returned as a single chunk. If Stream=True, it’s the number of bytes it should read into memory.
Raises: TenableIOApiException – When API error is encountered.
Returns: The downloaded file.
-
export_request(scan_id, scan_export, history_id=None)¶ Export the given scan. Once requested, the file can be downloaded using the export download method upon receiving a “ready” status from the export status method.
Parameters: - scan_id – The scan ID.
- scan_export – An instance of
ScanExportRequest. - history_id – The history ID of historical data.
Raises: TenableIOApiException – When API error is encountered.
Returns: The file ID.
-
export_status(scan_id, file_id)¶ Check the file status of an exported scan. When an export has been requested, it is necessary to poll this endpoint until a “ready” status is returned, at which point the file is complete and can be downloaded using the export download endpoint.
Parameters: - scan_id – The scan ID.
- file_id – The file ID.
Raises: TenableIOApiException – When API error is encountered.
Returns: The file status.
-
folder(scan_id, folder_id)¶ Move to a scan to a folder.
Parameters: - scan_id – The scan ID.
- folder_id – The folder ID.
Raises: TenableIOApiException – When API error is encountered.
Returns: True if successful.
-
history(scan_id, history_id)¶
-
host_details(scan_id, host_id)¶ Returns details for the given host.
Parameters: - scan_id – The scan ID.
- host_id – The host ID.
Raises: TenableIOApiException – When API error is encountered.
Returns: An instance of
tenable_io.api.models.ScanHostDetails.
-
import_scan(scan_import, include_aggregate=True)¶ Import an existing scan which has been uploaded using
TenableIO.FileApi.upload()Parameters: - scan_import – An instance of
ScanImportRequest. - include_aggregate – Boolean indicating whether scan data should appear in Workbenches.
Raises: TenableIOApiException – When API error is encountered.
Returns: The ID of the imported scan.
- scan_import – An instance of
-
launch(scan_id, scan_launch_request)¶ Launch a scan.
Parameters: - scan_id – The scan ID.
- scan_launch_request – An instance of
ScanLaunchRequest.
Raises: TenableIOApiException – When API error is encountered.
Returns: The scan uuid.
-
list(folder_id=None)¶ Return the scan list.
Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.ScanList.
-
pause(scan_id)¶ Pause a scan.
Parameters: scan_id – The scan ID. Raises: TenableIOApiException – When API error is encountered. Returns: True if successful.
-
resume(scan_id)¶ Resume a scan.
Parameters: scan_id – The scan ID. Raises: TenableIOApiException – When API error is encountered. Returns: True if successful.
-
stop(scan_id)¶ Stop a scan.
Parameters: scan_id – The scan ID. Raises: TenableIOApiException – When API error is encountered. Returns: True if successful.
-
tenable_io.api.server module¶
-
class
tenable_io.api.server.ServerApi(client)¶ Bases:
tenable_io.api.base.BaseApi-
properties()¶ Return the server version and other properties.
Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.ServerStatus.
-
status()¶ Return server status.
Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.ServerStatus.
-
tenable_io.api.session module¶
-
class
tenable_io.api.session.SessionApi(client)¶ Bases:
tenable_io.api.base.BaseApi-
get()¶ Return the user session data.
Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.Session.
-
tenable_io.api.target_groups module¶
-
class
tenable_io.api.target_groups.TargetGroupCreateRequest(name=None, members=None, type=None, acls=None)¶
-
class
tenable_io.api.target_groups.TargetGroupsApi(client)¶ Bases:
tenable_io.api.base.BaseApi-
create(target_group_create)¶ Create a new target group.
Parameters: target_group_create – An instance of TargetGroupCreateRequest.Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.TargetGroup.
-
delete(group_id)¶ Delete a target group.
Parameters: group_id – The group ID. Raises: TenableIOApiException – When API error is encountered. Returns: True if successful
-
details(group_id)¶ Return details of the target group.
Parameters: group_id – The group ID. Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.TargetGroup.
-
edit(target_group_edit, group_id)¶ Modify a target group.
Parameters: - target_group_edit – An instance of
TargetGroupCreateRequest - group_id – The group ID.
Raises: TenableIOApiException – When API error is encountered.
Returns: An instance of
tenable_io.api.models.TargetGroup- target_group_edit – An instance of
-
list()¶ Return the current target groups.
Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.TargetGroupList
-
-
class
tenable_io.api.target_groups.TargetListEditRequest(name=None, members=None, type=None, acls=None)¶ Bases:
tenable_io.api.target_groups.TargetGroupCreateRequest
tenable_io.api.users module¶
-
class
tenable_io.api.users.UserCreateRequest(username=None, password=None, permissions=None, name=None, email=None, type=None)¶
-
class
tenable_io.api.users.UserEditRequest(permissions=None, name=None, email=None)¶
-
class
tenable_io.api.users.UsersApi(client)¶ Bases:
tenable_io.api.base.BaseApi-
create(user_create)¶ Create a new user.
Parameters: user_create – An instance of UserCreateRequest.Raises: TenableIOApiException – When API error is encountered. Returns: The ID of the created user.
-
delete(user_id)¶ Delete a user.
Parameters: user_id – The user ID. Raises: TenableIOApiException – When API error is encountered. Returns: True if successful.
-
details(user_id)¶ Return details for the given user.
Parameters: user_id – The user ID. Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.User
-
edit(user_id, user_edit)¶ Edit an existing user.
Parameters: - user_id – The user ID.
- user_edit – An instance of
UserEditRequest.
Raises: TenableIOApiException – When API error is encountered.
Returns: An instance of
tenable_io.api.models.User.
-
enabled(user_id, enabled)¶ Enable or disable an user.
Parameters: - user_id – The user ID.
- enabled – True to enable. False to Disable.
Raises: TenableIOApiException – When API error is encountered.
Returns: True if successful.
-
get(user_id)¶
-
impersonate(user_id)¶
-
keys(user_id)¶ Generate the API Keys for the given user.
Parameters: user_id – The user ID. Raises: TenableIOApiException – When API error is encountered. Returns: An instance of tenable_io.api.models.UserKeys
-
list()¶ Return the user list.
Returns: An instance of tenable_io.api.models.UserList.
-
password(user_id, password)¶ Change the password for the given user.
Parameters: - user_id – The user ID.
- password – Current password for the user.
Raises: TenableIOApiException – When API error is encountered.
Returns: True if successful.
-
tenable_io.api.workbenches module¶
-
class
tenable_io.api.workbenches.WorkbenchesApi(client)¶ Bases:
tenable_io.api.base.BaseApi-
CHAPTER_EXEC_SUMMARY= u'exec_summary'¶
-
CHAPTER_VULN_BY_ASSET= u'vuln_by_asset'¶
-
CHAPTER_VULN_BY_PLUGIN= u'vuln_by_plugin'¶
-
CHAPTER_VULN_HOSTS_SUMMARY= u'vuln_hosts_summary'¶
-
FILTER_TYPE_AND= u'and'¶
-
FILTER_TYPE_OR= u'or'¶
-
FORMAT_CSV= u'csv'¶
-
FORMAT_HTML= u'html'¶
-
FORMAT_NESSUS= u'nessus'¶
-
FORMAT_PDF= u'pdf'¶
-
REPORT_VULNERABILITIES= u'vulnerabilities'¶
-
STATUS_EXPORT_READY= u'ready'¶
-
asset_activity(asset_id)¶ List detailed info of an asset.
Parameters: asset_id – The asset ID. Raises: TenableIOApiException – When API error is encountered. Returns: An instance of AssetInfo.
-
asset_info(asset_id)¶ List detailed info of an asset.
Parameters: asset_id – The asset ID. Raises: TenableIOApiException – When API error is encountered. Returns: An instance of AssetInfo.
-
asset_vulnerabilities(asset_id, date_range=None, filters=None, filter_search_type=None)¶ List all the vulnerabilities recorded for a given asset.
Parameters: - asset_id – The asset ID.
- date_range – The number of days of data prior to and including today that should be returned.
- filters – An array containing filters to apply to the exported scan report.
- filter_search_type – The type of search to be used. Can have a value of and**(default) or **or.
Raises: TenableIOApiException – When API error is encountered.
Returns: An instance of
VulnerabilityList.
-
assets(date_range=None, filters=None, filter_search_type=None)¶ List all the assets recorded.
Parameters: - date_range – The number of days of data prior to and including today that should be returned.
- filters – An array containing filters to apply to the exported scan report.
- filter_search_type – The type of search to be used. Can have a value of and**(default) or **or.
Raises: TenableIOApiException – When API error is encountered.
Returns: An instance of
AssetList.
-
assets_vulnerabilities(date_range=None, filters=None, filter_search_type=None)¶ List all the assets with vulnerabilities.
Parameters: - date_range – The number of days of data prior to and including today that should be returned.
- filters – An array containing filters to apply to the exported scan report.
- filter_search_type – The type of search to be used. Can have a value of and**(default) or **or.
Raises: TenableIOApiException – When API error is encountered.
Returns: An instance of
AssetList.
-
export_download(file_id, stream=True, chunk_size=1024)¶ Download a file that has been prepared for export.
Parameters: - file_id – The unique identifier of the workbench report being downloaded.
- stream – Default to True. If False, the response content will be immediately downloaded.
- chunk_size – If Stream=False, data is returned as a single chunk. If Stream=True, it’s the number of bytes it should read into memory.
Raises: TenableIOApiException – When API error is encountered.
Returns: The content iterator for the file.
-
export_request(format, report, chapter, start_date=None, date_range=None, filters=None, filter_search_type=None, minimum_vuln_info=None, plugin_id=None, asset_id=None)¶ Export the given workbench to a file.
Parameters: - format – The file format, one of FORMAT_CSV, FORMAT_HTML, FORMAT_NESSUS, FORMAT_PDF.
- report – The type of workbench report, one of REPORT_VULNERABILITIES.
- chapter – Chapter to include, one of CHAPTER_EXEC_SUMMARY, CHAPTER_VULN_BY_ASSET, CHAPTER_VULN_BY_PLUGIN, CHAPTER_VULN_HOSTS_SUMMARY.
- start_date – The date (in unixtime) at which the exported results should begin to be included, default to None which implies today.
- date_range – The number of days of data prior to and including start_date that should be returned. default to None which implies data for all dates is returned.
- filters – An list containing filters to apply to the exported scan report, default to None.
- filter_search_type – The type of search to be used, one of FILTER_TYPE_AND, FILTER_TYPE_OR, default to None.
- minimum_vuln_info – When True, only a minimal subset of scan details will be returned for each result, excluding plugin attributes. In this case, only plugin_output and vulnerability_state fields are always returned; first_found, last_found and last_fixed are also returned if possible. Default to None.
- plugin_id – Restrict the export data to only vulnerabilities found by the plugin with this id, default to None.
- asset_id – Restrict the export data to only findings the asset with this id. Note that this id is a UUID, default to None.
Raises: TenableIOApiException – When API error is encountered.
Returns: The file ID.
-
export_status(file_id)¶ Retrieve the status of a pending export.
Parameters: file_id – The file ID. Raises: TenableIOApiException – When API error is encountered. Returns: The file status.
-
vulnerabilities(age=None, authenticated=None, date_range=None, exploitable=None, filters=None, filter_search_type=None, resolvable=None, severity=None)¶ List all the vulnerabilities recorded.
Parameters: - age – Lists only those vulnerabilities older than a certain number of days.
- authenticated – Lists only authenticated vulnerabilities.
- date_range – The number of days of data prior to and including today that should be returned.
- exploitable – Lists only exploitable vulnerabilities.
- filters – An array containing filters to apply to the exported scan report.
- filter_search_type – The type of search to be used. Can have a value of and**(default) or **or.
- resolvable – Lists only those vulnerabilities with a remediation path.
- severity – Lists only vulnerabilities of a specific severity (critical, high, medium or low).
Raises: TenableIOApiException – When API error is encountered.
Returns: An instance of
VulnerabilityList.
-
vulnerability_output(plugin_id, date_range=None, filters=None, filter_search_type=None)¶ Get the vulnerability outputs for a plugin.
Parameters: - plugin_id – The plugin id.
- date_range – The number of days of data prior to and including today that should be returned.
- filters – An array containing filters to apply to the exported scan report.
- filter_search_type – The type of search to be used. Can have a value of and**(default) or **or.
Raises: TenableIOApiException – When API error is encountered.
Returns: An instance of
VulnerabilityOutputList.
-