Skip to main content

Python library to interface into Tenable's products and applications

Project description

https://img.shields.io/pypi/v/pytenable.svg https://img.shields.io/badge/python-3.10%2B-blue https://img.shields.io/readthedocs/pytenable 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(access_key='TIO_ACCESS_KEY', secret_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(url='https://SC_URL', access_key='AKEY', secret_key='SKEY')
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.9.0.tar.gz (277.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytenable-1.9.0-py3-none-any.whl (397.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytenable-1.9.0.tar.gz
  • Upload date:
  • Size: 277.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pytenable-1.9.0.tar.gz
Algorithm Hash digest
SHA256 c6d3e9479923e8e846ba7f1de421329ed72c43da57d068d0bea75a50d1baec87
MD5 451acc267aaa251f92b59645e6eaf383
BLAKE2b-256 b1af36c91b3f2231338400fc2275ff9df71ccb175ca9df4b16ee58bb39523893

See more details on using hashes here.

File details

Details for the file pytenable-1.9.0-py3-none-any.whl.

File metadata

  • Download URL: pytenable-1.9.0-py3-none-any.whl
  • Upload date:
  • Size: 397.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pytenable-1.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc129fb55e18ce82b5bfd9f87464c79b54278f4985d4b91bd8f38ff105fa9852
MD5 e0c39bb2d7fa83928587699320645a0b
BLAKE2b-256 854b751acc423b7cb1fc50bdf3aff70bc35627d410bd8195e50a01bd6b933158

See more details on using hashes here.

Supported by

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