Skip to main content

Python library to interface into Tenable's products and applications

Project description

https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Ftenable%2FpyTenable%2Fbadge&label=build https://img.shields.io/pypi/v/pytenable.svg https://img.shields.io/badge/python-3.7%203.8%203.9%203.10%203.11-blue https://img.shields.io/pypi/dm/pytenable https://img.shields.io/github/license/tenable/pyTenable.svg https://sonarcloud.io/api/project_badges/measure?project=tenable_pyTenable&metric=alert_status

pyTenable is intended to be a pythonic interface into the Tenable application APIs. Further by providing a common interface and a common structure between all of the various applications, we can ease the transition from the vastly different APIs between some of the products.

Installation

To install the most recent published version to pypi, its simply a matter of installing via pip:

pip install pytenable

If you’re looking for bleeding-edge, then feel free to install directly from the github repository like so:

pip install git+git://github.com/tenable/pytenable.git#egg=pytenable

Getting Started

Lets assume that we want to get the list of scans that have been run on our Tenable.io application. Performing this action is as simple as the following:

from tenable.io import TenableIO
tio = TenableIO('TIO_ACCESS_KEY', 'TIO_SECRET_KEY')
for scan in tio.scans.list():
   print('{status}: {id}/{uuid} - {name}'.format(**scan))

Getting started with Tenable.sc is equally as easy:

from tenable.sc import TenableSC
sc = TenableSC('SECURITYCENTER_NETWORK_ADDRESS')
sc.login('SC_USERNAME', 'SC_PASSWORD')
for vuln in sc.analysis.vulns():
   print('{ip}:{pluginID}:{pluginName}'.format(**vuln))

For more detailed information on whats available, please refer to the pyTenable Documentation

Logging

Enabling logging for pyTenable is a simple matter of enabling debug logs through the python logging package. An easy example is detailed here:

import logging
logging.basicConfig(level=logging.DEBUG)

License

The project is licensed under the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytenable-1.5.3.tar.gz (245.5 kB view details)

Uploaded Source

Built Distribution

pyTenable-1.5.3-py3-none-any.whl (354.9 kB view details)

Uploaded Python 3

File details

Details for the file pytenable-1.5.3.tar.gz.

File metadata

  • Download URL: pytenable-1.5.3.tar.gz
  • Upload date:
  • Size: 245.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.20

File hashes

Hashes for pytenable-1.5.3.tar.gz
Algorithm Hash digest
SHA256 b47b046510dc8a9e98965355c95939d973a8d913fe969ecf9a555d71deb24dc1
MD5 10fdae7ce015be698336264c9b38baf7
BLAKE2b-256 8a3d09e561c0814a343b63a255c312c064c8114ff39d773fcc75a6049ba6d621

See more details on using hashes here.

File details

Details for the file pyTenable-1.5.3-py3-none-any.whl.

File metadata

  • Download URL: pyTenable-1.5.3-py3-none-any.whl
  • Upload date:
  • Size: 354.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.20

File hashes

Hashes for pyTenable-1.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f85c11564d66eac6ae310f4bb0bccb94f9b0425e6cbaee55b18882b3eaa9a6df
MD5 823c67a4ced9cb9da36d382359b45265
BLAKE2b-256 44c3a7bc5dc0b9bcd68da47e90cf83d560fbf0a8c9bb1c6e614623266f35f2bc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page