[docs]classTenableIO(APIPlatform):# noqa: PLR0904""" The Tenable Vulnerability Management object is the primary interaction point for users to interface with Tenable Vulnerability Management via the pyTenable library. All the API endpoint classes that have been written will be grafted onto this class. Args: access_key (str, optional): The user's API access key for Tenable Vulnerability Management. If an access key isn't specified, then the library will attempt to read the environment variable ``TIO_ACCESS_KEY`` to acquire the key. secret_key (str, optional): The user's API secret key for Tenable Vulnerability Management. If a secret key isn't specified, then the library will attempt to read the environment variable ``TIO_SECRET_KEY`` to acquire the key. url (str, optional): The base URL that the paths will be appended onto. The default is ``https://cloud.tenable.com`` retries (int, optional): The number of retries to make before failing a request. The default is ``5``. backoff (float, optional): If a 429 response is returned, how much do we want to backoff if the response didn't send a Retry-After header. The default backoff is ``1`` second. vendor (str, optional): The vendor name for the User-Agent string. product (str, optional): The product name for the User-Agent string. build (str, optional): The version or build identifier for the User-Agent string. timeout (int, optional): The connection timeout parameter informing the library how long to wait in seconds for a stalled response before terminating the connection. If unspecified, the default is 120 seconds. Examples: Basic Example: >>> from tenable.io import TenableIO >>> tio = TenableIO('ACCESS_KEY', 'SECRET_KEY') Example with proper identification: >>> tio = TenableIO('ACCESS_KEY', 'SECRET_KEY', >>> vendor='Company Name', >>> product='My Awesome Widget', >>> build='1.0.0') Example with proper identification leveraging environment variables for access and secret keys: >>> tio = TenableIO( >>> vendor='Company Name', product='Widget', build='1.0.0') """_env_base='TIO'_tzcache=None_url='https://cloud.tenable.com'_timeout=120def__init__(self,access_key:Optional[str]=None,secret_key:Optional[str]=None,**kwargs,):ifaccess_key:kwargs['access_key']=access_keyifsecret_key:kwargs['secret_key']=secret_keysuper().__init__(**kwargs)def_retry_request(self,response:Response,retries:int,**kwargs)->Dict:""" If the call is retried, we will need to set some additional headers """kwargs['headers']=kwargs.get('headers',{})# if the request uuid exists in the response, then we will send the# uuid back so that there is solid request chain in the Tenable Vulnerability Management# platform logs.request_uuid=response.headers.get('X-Tio-Last-Request-Uuid')ifrequest_uuid:kwargs['headers']['X-Tio-Last-Request-Uuid']=request_uuid# We also need to return the number of times that we have attempted to# retry this call.kwargs['headers']['X-Tio-Retry-Count']=str(retries)# Return the keyword arguments back to the caller.returnkwargs@propertydef_tz(self):""" As we will be using the timezone listing in a lot of parameter checking, we should probably cache the response as a private attribute to speed up checking times. """ifnotself._tzcacheandself._auth_mech:self._tzcache=self.scans.timezones()returnself._tzcache@propertydefcs(self):""" The interface object for the :doc:`Tenable Vulnerability Management Container Security APIs <cs/index>`. """returnContainerSecurity(self)@propertydefaccess_control(self):""" The interface object for the :doc:`Tenable Vulnerability Management Access Control APIs <access_control>`. """returnAccessControlAPI(self)@propertydefagent_config(self):""" The interface object for the :doc:`Tenable Vulnerability Management Agent Config APIs <agent_config>`. """returnAgentConfigAPI(self)@propertydefagent_groups(self):""" The interface object for the :doc:`Tenable Vulnerability Management Agent Groups APIs <agent_groups>`. """returnAgentGroupsAPI(self)@propertydefagent_exclusions(self):""" The interface object for the :doc:`Tenable Vulnerability Management Agent Exclusions APIs <agent_exclusions>`. """returnAgentExclusionsAPI(self)@propertydefagents(self):""" The interface object for the :doc:`Tenable Vulnerability Management Agents APIs <agents>`. """returnAgentsAPI(self)@propertydefassets(self):""" The interface object for the :doc:`Tenable Vulnerability Management assets APIs <assets>`. """returnAssetsAPI(self)@propertydefaudit_log(self):""" The interface object for the :doc:`Tenable Vulnerability Management Audit Log APIs <audit_log>`. """returnAuditLogAPI(self)@propertydefcredentials(self):""" The interface object for the :doc:`Tenable Vulnerability Management Credentials APIs <credentials>`. """returnCredentialsAPI(self)@propertydefeditor(self):""" The interface object for the :doc:`Tenable Vulnerability Management Editor APIs <editor>`. """returnEditorAPI(self)@propertydefexclusions(self):""" The interface object for the :doc:`Tenable Vulnerability Management Exclusions APIs <exclusions>`. """returnExclusionsAPI(self)@propertydefexports(self):""" The interface object for the :doc:`Tenable Vulnerability Management Exports APIs <exports>`. """returnExportsAPI(self)@propertydeffiles(self):""" The interface object for the :doc:`Tenable Vulnerability Management Files APIs <files>`. """returnFileAPI(self)@propertydeffilters(self):""" The interface object for the :doc:`Tenable Vulnerability Management Filters APIs <filters>`. """returnFiltersAPI(self)@propertydeffolders(self):""" The interface object for the :doc:`Tenable Vulnerability Management Folders APIs <folders>`. """returnFoldersAPI(self)@propertydefgroups(self):""" The interface object for the :doc:`Tenable Vulnerability Management Groups APIs <groups>`. """returnGroupsAPI(self)@propertydefnetworks(self):""" The interface object for the :doc:`Tenable Vulnerability Management Networks APIs <networks>`. """returnNetworksAPI(self)@propertydefpci(self)->PCIASVAPI:""" The interface for :doc:`TVM PCI-ACV APIs <pci/index>`. """returnPCIASVAPI(self)@propertydefpermissions(self):""" The interface object for the :doc:`Tenable Vulnerability Management Permissions APIs <permissions>`. """returnPermissionsAPI(self)@propertydefplugins(self):""" The interface object for the :doc:`Tenable Vulnerability Management Plugins APIs <plugins>`. """returnPluginsAPI(self)@propertydefpolicies(self):""" The interface object for the :doc:`Tenable Vulnerability Management Policies APIs <policies>`. """returnPoliciesAPI(self)@propertydefscanner_groups(self):""" The interface object for the :doc:`Tenable Vulnerability Management Scanner Groups APIs <scanner_groups>`. """returnScannerGroupsAPI(self)@propertydefscanners(self):""" The interface object for the :doc:`Tenable Vulnerability Management Scanners APIs <scanners>`. """returnScannersAPI(self)@propertydefscans(self):""" The interface object for the :doc:`Tenable Vulnerability Management Scans APIs <scans>`. """returnScansAPI(self)@propertydefremediationscans(self):""" The interface object for the :doc:`Tenable Vulnerability Management Remediation Scans APIs <remediation_scans>`. """returnRemediationScansAPI(self)@propertydefserver(self):""" The interface object for the :doc:`Tenable Vulnerability Management Server APIs <server>`. """returnServerAPI(self)@propertydefsession(self):""" The interface object for the :doc:`Tenable Vulnerability Management Session APIs <session>`. """returnSessionAPI(self)@propertydeftags(self):""" The interface object for the :doc:`Tenable Vulnerability Management Tags APIs <tags>`. """returnTagsAPI(self)@propertydefusers(self):""" The interface object for the :doc:`Tenable Vulnerability Management Users APIs <users>`. """returnUsersAPI(self)@propertydefworkbenches(self):""" The interface object for the :doc:`Tenable Vulnerability Management Workbenches APIs <workbenches>`. """warnings.warn('The workbench module been deprecated from the TVM ''package. This method will be removed in a future ''version of the SDK. Please use the exports sub-pkg ''instead.',DeprecationWarning,stacklevel=2,)returnWorkbenchesAPI(self)@propertydefv3(self):warnings.warn('The V3 sub-pkg have been deprecated from the TVM ''package. This method will be removed in a future ''version of the SDK. Please use the relocated modules ''within the package',DeprecationWarning,stacklevel=2,)returnVersion3API(self)@propertydefwas(self):""" The interface object for the :doc:`Tenable Vulnerability Management WAS APIs <was>`. """returnWasAPI(self)
# @property# def sync(self):# """# The interface object for the# :doc:`Tenable Vulnerability Management Synchronization APIs <sync>`.# """# return SynchronizationAPI(self)