ContainerSecurity¶
-
class
ContainerSecurity
(access_key=None, secret_key=None, registry=None, url=None, retries=None, backoff=None, ua_identity=None, session=None, proxies=None, vendor=None, product=None, build=None)[source]¶ The Container Security object is the primary interaction point for users to interface with Container Security via the pyTenable library. All of the API endpoint classes that have been written will be grafted onto this class.
Parameters: - access_key (str) – The user’s API access key for Tenable.io.
- secret_key (str) – The user’s API secret key for Tenable.io.
- url (str, optional) – The base URL that the paths will be appended onto. The default
is
https://cloud.tenable.com
. - registry (str, optional) – The registry path to use for docker pushes. The default is
registry.cloud.tenable.com
. - retries (int, optional) – The number of retries to make before failing a request. The
default is
3
. - 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
0.1
seconds.
images¶
The images methods allow interaction into ContainerSecurity image API.
Methods available on cs.images
:
reports¶
The reports methods allow interaction into ContainerSecurity reports API.
Methods available on cs.reports
:
repositories¶
The repositories methods allow interaction into ContainerSecurity repositories API.
Methods available on cs.repositories
:
uploads¶
The uploads methods are abstractions to make uploading an image into Container Security easier for the user.
Methods available on cs.uploads
:
usage¶
The usage methods allow interaction into ContainerSecurity usage API.
Methods available on cs.usage
:
Raw HTTP Calls¶
Even though the ContainerSecurity
object pythonizes the Container
Security API for you, there may still bee the occasional need to make raw HTTP
calls to the Container Security API. The methods listed below aren’t run
through any naturalization by the library aside from the response code checking.
These methods effectively route directly into the requests session. The
responses will be Response objects from the requests
library. In all cases,
the path is appended to the base url
paramater that the
ContainerSecurity
object was instantiated with.
Example:
resp = cs.get('repositories')