Tenable Attack Surface Management

This package covers the Tenable ASM application.

class TenableASM(**kwargs)[source]

The TenableASM class is the primary interaction point for users to interface with Tenable Attack Surface Management via the pyTenable library. All the API endpoint classes that wrap the various aspects of ASM will be attached to this base class.

Parameters:
  • api_key (str, optional) – The user’s API key to interface into Tenable ASM. If the key isn’t specified, then the library will attempt to read the environment variable TASM_API_KEY to get the key.

  • url (str, optional) – The base URL that the paths will be appended onto. If the url isn’t specified, then the library will attempt to read the environment variable TASM_URL.

  • 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.asm import TenableASM
>>> tasm = TenableASM(url='https://asm.cloud.tenable.com',
...                   api_key='abcdef1234567890'
...                   )

Another example with proper identification:

>>> tasm = TenableASM(url='https://asm.cloud.tenable.com',
...                   api_key='abcdef1234567890',
...                   vendor='Company Name',
...                   product='My Awesome Widget',
...                   build='1.0.0'
...                   )

Yet another example thats leveraging the TASM_API_KEY and TASM_URL environment variables:

>>> os.environ['TASM_URL'] = 'https://asm.cloud.tenable.com'
>>> os.environ['TASM_API_KEY'] = 'abcdef1234567890'
>>> tasm = TenableASM(vendor='Company Name',
...                   product='My Awesome Widget',
...                   build='1.0.0'
...                   )
property inventory

The interface object for the Tenable ASM Inventory API

property smart_folders

The interface object for the Tenable ASM Smart Folders API