Images

The following methods allow for interaction into the Tenable Vulnerability Management Container Security images API endpoints.

Methods available on tio.cs.images:

class ImagesAPI(api: restfly.session.APISession)[source]
delete(repository: str, image: str, tag: str) None[source]

Deleted the specified image.

API Documentation

Parameters
  • repository (str) – The repository name.

  • image (str) – The image name.

  • tag (str) – The tag name.

Examples

>>> tio.cs.images.delete('centos', '7', 'latest')
details(repository: str, image: str, tag: str) Dict[source]

Returns the details for the specified image.

API Documentation # noqa: E501

Parameters
  • repository (str) – The repository name.

  • image (str) – The image name.

  • tag (str) – The tag name.

Examples

>>> tio.cs.images.details('centos', '7', 'latest')
list(name: Optional[str] = None, repo: Optional[str] = None, tag: Optional[str] = None, has_malware: Optional[bool] = None, score: Optional[int] = None, score_operator: Optional[typing_extensions.Literal[EQ, GT, LT]] = None, os: Optional[str] = None, offset: int = 0, limit: int = 1000, return_json: bool = False) Union[Dict, tenable.io.cs.iterator.CSIterator][source]

Returns the list of images stored within Container Security.

API Documentation

Parameters
  • name (str, optional) – Image name to filter on. Filter is case-sensitive and enforces an exact match.

  • repo (str, optional) – Repository name to filter on. Filter is case-sensitive and enforces an exact match.

  • tag (str, optional) – Tag to filter on. Filter is case-sensitive and enforces an exact match.

  • has_malware (bool, optional) – Specifies whether to return only images with malware associated to them.

  • score (int, optional) – The score value to filter on.

  • score_operator (str, optional) – The score operator to use with the score value. Supported operations are EQ (equal), GT (greater-than), and LT (less-than).

  • os (str, optional) – The operating system to filter on. Filter is case-sensitive and enforces an exact match.

  • offset (int, optional) – The number of records to skip before starting to return data.

  • limit (int, optional) – The number of records to return for each page of data.

  • return_json (bool, optional) – If set, then the response will instead be a Dict object instead of an iterable.

Examples

Using the default iterable:

>>> for image in tio.cs.images.list():
...     print(image)

Getting the raw JSON response:

>>> resp = tio.cs.images.list(return_json=True)
>>> for item in resp['items']:
...     print(item)