Search Workloads for Vulnerabilities
POST {{cb_url}}/containers/v1beta/orgs/{{cb_org_key}}/workloads/_search
List workloads with a specific vulnerabilities.
RBAC Permissions Required
Permission (.notation name) | Operation(s) |
---|---|
kubernetes.security | READ |
Request Schema
{
"criteria": {
"cves": [
{
"cve": "<string>",
"package": "<string>",
"type": "<string>"
}
],
"images": [
"<string>"
]
},
"query": "<string>",
"start": 0,
"rows": 20,
"sort": [
{
"field": "<string>",
"order": "<string>"
},
{
"field": "<string>",
"order": "<string>"
}
]
}
Response Schema
{
"num_found": <integer>,
"results": [
{
"policy": {
"name": "<string>",
"policy_id": "<string>"
},
"risk": {
"score": <float>,
"severity": {}
},
"scopes": [
{
"policy_name": "<string>",
"scope_id": "<string>"
}
],
"cluster": "<string>",
"kind": "<string>",
"name": "<string>",
"namespace": "<string>"
},
{
"policy": {
"name": "<string>",
"policy_id": "<string>"
},
"risk": {
"score": <float>,
"severity": {}
},
"scopes": [
{
"policy_name": "<string>",
"scope_id": "<string>"
}
],
"cluster": "<string>",
"kind": "<string>",
"name": "<string>",
"namespace": "<string>"
}
]
}
Request Body
{"criteria"=>{"cves"=>[{"cve"=>"ALAS-2021-1722", "package"=>"nspr", "type"=>"rpm"}]}, "query"=>"", "start"=>0, "rows"=>20, "sort"=>[{"field"=>"vulnerabilities", "order"=>"DESC"}]}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
Accept | string |
RESPONSES
status: OK
"{\n \"num_found\": 1,\n \"results\": [\n {\n \"cluster\": \"testcluster\",\n \"container_images\": [\n {\n \"full_tag\": \"fulltag/demo.container\",\n \"manifest_digest\": \"sha256:1234asdfrtyu876543fb228e8d5f9cea9311a12b0b7d884b9e1dc7665aad83047b\",\n \"registry\": \"123456789123.demo.org.host.company.com\",\n \"repo\": \"demo-repo\",\n \"repo_digests\": [\n \"\"\n ],\n \"tag\": \"v1.2.3-demobuild.1\"\n }\n ],\n \"enforcements\": 0,\n \"kind\": \"DaemonSet\",\n \"name\": \"aws-node\",\n \"namespace\": \"kube-system\",\n \"policy\": {\n \"name\": \"demo policy\",\n \"policy_id\": \"1a2b3456-ce51-4569-94a1-defa909e1615\"\n },\n \"risk\": {\n \"score\": 9,\n \"severity\": \"high\"\n },\n \"scopes\": [\n {\n \"policy_id\": \"1a2b3456-ce51-4569-94a1-defa909e1615\",\n \"policy_name\": \"demo policy\",\n \"scope_id\": \"9876543a-a607-4377-8ca3-d1020ad8fb85\",\n \"scope_name\": \"demo-scope\"\n },\n ],\n \"violations\": 0\n }\n ]\n}"