Tenable.ot

This package covers the Tenable.ot interface.

class TenableOT(**kwargs)[source]

The Tenable.ot object is the primary interaction point for users to interface with Tenable.io via the pyTenable library. All of the API endpoint classes that have been written will be grafted onto this class.

Parameters
  • secret_key (str, optional) – The user’s API secret key for Tenable.ot.

  • port (int, optional) – The port to connect to on the Tenable.ot host. If left unspecified, then the library will attempt to connect on port 443.

  • **kwargs – arguments passed to tenable.base.platform.APIPlatform for connection management.

Examples

Basic Example:

>>> from tenable.ot import TenableOT
>>> ot = TenableOT(secret_key='SECRET_KEY', address='ot.example.com')

Example with proper identification:

>>> ot = TenableOT(secret_key='SECRET_KEY', address='ot.example.com',
>>>     vendor='Company Name',
>>>     product='My Awesome Widget',
>>>     build='1.0.0')

Example with proper identification leveraging environment variables for the connection parameters:

>>> ot = TenableOT(vendor='Company', product='Widget', build='1.0.0')
property assets

The interface object for the Tenable.ot Assets APIs.

graphql(**kwargs)[source]

GraphQL Endpoint

This singular method exposes the GraphQL API to the library. As all keyword arguments are passed directly to the JSON body, it allows for a freeform interface into the GraphQL API.

Parameters

**kwargs (dict, optional) – The key/values that should be passed to the body of the GraphQL request.

Example

>>> ot.graphql(
...     variables={'asset': 'b64 id string'},
...     query='''
...         query getAssetDetails($asset: ID!) {
...             asset(id: $asset) {
...                 id
...                 type
...                 name
...                 criticality
...                 location
...             }
...         }
... ''')
property network_interfaces

The interface object for the Tenable.ot Network Interfaces APIs.

property vulns

The interface object for the Tenable.ot Vulnerabilities APIs.