List Workloads

Description: List of Workloads

Security: Requires a valid user with a "Read" permission

Usage: POST /runtime/api/v1/workloads

Consumes: application/json

Produces: application/json

Request Body:

NameTypeRequired/OptionalDescription
limitintoptionalKey-based pagination - number of rows per request. Default: 10
next_keystringoptionalId from the previous request, empty on the first request
order_bystringoptionalAvailable options: name, cluster,runtime_status ,vulnerabilties_count, registry, risks
filtersfilterObjoptionalFilter the results by the available filters listed in filter_object

filterObj:

Name

Type

Required/Optional

Description

time_period

optional

Default - now
Options: now, 1 hour, 24 hours, 3 days, 7 days, 10 days

cve_id

array[string]

optional

CVE identifier

risk

array

optional

malicious, untrusted_registry, integrity_violation, critical_applicable

component

Array[filterComponentObj]

  • all components

applicability

Array of app_enum

optional

Contextual Analysis result.

Possible values: not_scanned, applicable,

not_applicable, undetermined, rescan_required, upgrade_required, not_covered

severity

array[string]

optional

Contextual Analysis result.

Possible values: not_scanned, applicable,

not_applicable, undetermined, rescan_required, upgrade_required, not_covered

workloads

Array[filterWorkloadObj]

optional

If added return data only on workloads that are in the list

namespace

array[string]

optional

Filters the results by namespace. Returns only images that belong to any of the namespaces listed.

filterComponentObj:

NameTypeRequired/OptionalDescription
namestringrequiredComponent name
versionstringoptionalComponent version; if not provided, all versions are returned

filterWorkloadObj:

NameTyoeRequired/OptionalDescription
namestringrequired
namespacestringoptionalName of name space; if not provided all matches the other params (name & cluster)
clusterstringoptionalName of cluster; if not provided all matches the other params (name & namespace)

Response body

NameTypeDescription
total_countintThe total number of images tags that match the filter quarry
paginationpaginationObjPagination info for the request
workloadsArray [workloadObj]

paginationObj:

NameTypeDescription
limitintKey-based pagination - number of rows per request
next_keystringId from the previous request, empty on the first request

workloadObj:

NameTypeDescription
namestringWorkload name
namespacestring
clusterstring
runtime_statusstringPossible values: running, stopped, unknown
nodesArray of string
architecturestringarch_names
risksArray[ risk_enum]

Possible values: malicious, untrusted_registry, integrity_violation, critical_applicable_cves

untrusted_registry, integrity_violation inherent from images and rest aggregation from process

vulnerabilities_countintThe sum of all vulnerabilities of the process
processesArray[processObj]

processesObj:

NameTypeDescription
namestring
runtime_statusenumrunning / stopped / unknown
risksArray of risk_enumMalicious/ untrusted_registry/ integrity_violation/ critical_applicable
vulnerabilitiesArray[vulnObj]An array of the vulnerabilities detected on the process
malicious_packagesArray[maliciousObj]An array of malicious packages detected on the image tag
argumentsstring
pathstringFile system path
process_hashstringThe SHA-256 hash of the process executable file
image_digeststringThe SHA-256 digest of the container image the process is running from

vulnObj:

NameTypeDescription
cve_idstringCVE identifier
xray_idstringXray identifier
severitystringSeverity level of the issue (e.g., "High")
cvss_v2stringCVSS version 2 score
cvss_v3stringCVSS version 3 score
applicabilitystring

Contextual Analysis result.

Possible values: not_scanned, applicable,

not_applicable, undetermined, rescan_required, upgrade_required, not_covered

componentsarray[componentObj]The components information

maliciousObj:

NameTypeDescription
xray_idstringXray identifier
componentsarray[componentObj]The component information

componentObj:

NameTypeDescription
component_idstringThe component identifier in the Xray format (e.g., "gav://com.thoughtworks.xstream:xstream:1.4.5")
namestringComponent name
versionstringComponent version

Response Codes:

Status codeDescription
200OK
400Bad request - Required fields are missing
403Permission denied
404Not found
500Internal server error

Examples

Example request

{
  "limit": 50,
  "last_key": "id123",
  "filters": {
    "severities": [
      "Critical",
      "High"
    ],
    "workloads": [
      {
        "name": "corends",
        "namespace": "jfs-production",
        "cluster": "jfs-production"
      }
    ]
  }
}

Example successful response

{
  "pagination": {
    "total_count": 105,
    "next_key": "87319827319827",
    "limit": 1
  },
  "workloads": [
    {
      "name": "demo-security",
      "namespace": "my-namespace",
      "cluster": "my-cluster",
      "runtime_status": "running",
      "nodes": [
        "10-0-0-1",
        "10-0-0-2"
      ],
      "architecture": "amd64",
      "risks": [
        "critical_applicable_cves"
      ],
      "vulnerabilities_count": 1,
      "processes": [
        {
          "name": "my-process",
          "arguments":"my-process-args",
          "path":"/bin/my-process",
          "runtime_status": "running",
          "risks": [
            "critical_applicable_cves"
          ],
          "vulnerabilities": [
            {
              "cve_id": "CVE-2022-1471",
              "applicability": "applicable",
              "components": [
                {
                  "id": "gav://org.yaml:snakeyaml:1.26",
                  "name": "org.yaml:snakeyaml",
                  "version": "1.26"
                }
              ],
              "cve_id": "CVE-2022-1471",
              "cvss_v2": "",
              "cvss_v3": "9.8",
              "severity": "Critical",
              "xray_id": "<XRAY_ID>"
            }
          ],
          "malicious_packages":[],
          "image_digest":"<image_sha256>",
          "process_hash":"<process_executable_sha256>"
        }
      ]
    }
  ]
}

Example error response:

404 Not Found
{
    "error": "error message"
}