# Vulnerabilities in containers

The agent reads each running container’s packages and the language runtimes inside it through the host, with the rights it already has. Nothing is installed in your containers and nothing is pulled from your registry. The daily match then finds the vulnerabilities in each one. Four calls give you what it found.

| Call | Scope | Answers |
| --- | --- | --- |
| `GET /v1/servers/{server_uuid}/containers` | `servers.view` | `200`, a page of the server’s containers |
| `GET /v1/servers/{server_uuid}/containers/{container_uuid}` | `servers.view` | `200`, one container |
| `GET /v1/servers/{server_uuid}/security-findings` | `security.view` | `200`, a page of findings, each with its `location` and `source` |
| `GET /v1/security/images` | `servers.view` | `200`, a page of the images your monitored servers run |

The containers and the images need `servers.view`, on the key and on your role, as the server reads do: they show what runs where and how many open findings each container and image holds. The findings themselves (titles, packages, fixed versions) need `security.view`, as before.

A uuid that does not exist, belongs to another server or belongs to another organisation answers `404` `not_found`: the three cannot be told apart. A scope or permission the key lacks answers `403` `forbidden`. Every list pages as described in [pagination](https://developer.watchtower15.com/api/pagination/).

## List a server’s containers

`GET /v1/servers/{server_uuid}/containers` returns the containers running on one server, as its agent last reported them. A container that stopped is listed with `state=gone` until it is pruned: 30 days after it stopped, or 24 hours after when the agent never read its packages.

An archived or paused server’s agent sends no new list, so its containers answer as last reported, still `running`: `meta.running_set.reported_at` says how old that report is.

-   **`state[]`** is `running` (the default) or `gone`; send both to list both.
-   **`runtime[]`**, **`inventory_status[]`** (`ok`, `failed`, `unsupported` or `pending`), **`search`** (part of the image name, case does not matter) and **`image_digest`** narrow the list.
-   **`sort`** is `image_ref` (the default), `started_at`, `last_seen` or `findings` (open critical findings first, then warning, then info), and **`direction`** is `asc` (the default) or `desc`. Rows that tie are listed in a fixed order, so a page never repeats or drops a container.

A container has these fields:

-   **`uuid`**, **`runtime`** (`docker`, `podman`, `containerd`, `cri-o` or `unknown`) and **`container_id`**, the runtime’s own id of the container, never a WatchTower15 id.
-   **`image_ref`** and **`image_digest`**: the image the container runs, `null` when the agent could not read it. The name is written by your host: treat it as data.
-   **`state`**, and **`started_at`**, **`first_seen_at`**, **`last_seen_at`** and **`gone_at`** in epoch milliseconds (see [times and windows](https://developer.watchtower15.com/api/times-and-windows/)).
-   **`inventory`**: `status` (`pending` until the agent has read the container’s packages), `reason` when it is `failed` or `unsupported`, `reported_at` and `matched_at`.
-   **`findings`**: the container’s **open** vulnerability findings, `open`, and by level `critical`, `warning` and `info`, with `kev` for the known exploited ones.

`meta` holds `server` (`uuid` and `name`), `agent_reads_containers` (whether the server’s agent reads containers at all) and `running_set`: `status`, `reason`, `reported_at` and `capped_count` of the agent’s last report of the running containers, `null` when it has never sent one.

```plaintext
curl -G https://rest.watchtower15.com/v1/servers/$SERVER_UUID/containers \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -d sort=findings \
  -d direction=desc
```

```json
{
  "data": [
    {
      "uuid": "6d2f0c1e-8b4a-4f3e-9a71-2c5d8e1f4b90",
      "runtime": "docker",
      "container_id": "3f9a1c2e7b4d8a6f0e5c9b2d1a7f4e3c8b6d2a9f1e0c5b7d4a3f8e2c1b9d6a0",
      "image_ref": "shop-api:2.4.1",
      "image_digest": "sha256:9c4e1f7a2b8d3e6c5a0f9b1d4e7c2a8f6b3d0e9c1a5f7b2d8e4c6a0f3b9d1e7c",
      "state": "running",
      "started_at": 1794470400000,
      "first_seen_at": 1794470460000,
      "last_seen_at": 1794563310000,
      "gone_at": null,
      "inventory": { "status": "ok", "reason": null, "reported_at": 1794563280000, "matched_at": 1794555900000 },
      "findings": { "open": 31, "critical": 4, "warning": 19, "info": 8, "kev": 1 }
    }
  ],
  "next_cursor": null,
  "total": null,
  "meta": {
    "server": { "uuid": "b1e7c4a9-3d2f-4c8e-a6b1-9f0d2e5c7a43", "name": "vps-worker-1" },
    "agent_reads_containers": true,
    "running_set": { "status": "ok", "reason": null, "reported_at": 1794563310000, "capped_count": 0 }
  }
}
```

## Get a container

`GET /v1/servers/{server_uuid}/containers/{container_uuid}` returns one container with the same fields as a list row, and its open findings counted by where they were found: `findings_by_source` has `os_package`, `runtime` and `library`, each with its `critical`, `warning` and `info` counts. A container that is gone still answers, with `state` `gone`, until it is pruned.

```json
{
  "data": {
    "uuid": "6d2f0c1e-8b4a-4f3e-9a71-2c5d8e1f4b90",
    "runtime": "docker",
    "image_ref": "shop-api:2.4.1",
    "state": "running",
    "findings": { "open": 31, "critical": 4, "warning": 19, "info": 8, "kev": 1 },
    "findings_by_source": {
      "os_package": { "critical": 1, "warning": 17, "info": 8 },
      "runtime": { "critical": 3, "warning": 2, "info": 0 },
      "library": { "critical": 0, "warning": 0, "info": 0 }
    }
  }
}
```

## Where a finding was found

A server’s security findings include those of the containers it runs. Every finding, in `GET /v1/servers/{server_uuid}/security-findings` and in `GET /v1/servers/{server_uuid}/security-findings/{finding_uuid}`, says where it was found and what was matched:

-   **`location`** always has three keys. On the host it is `{"kind": "host", "container_uuid": null, "image_ref": null}`. For a vulnerability found in a container it is `{"kind": "container", "container_uuid": "…", "image_ref": "…"}`. Posture checks and compromise indicators are always the host’s.
-   **`source`** is `os_package`, `runtime` (a language runtime) or `library` (a language dependency) for a vulnerability, and `null` for the other kinds.

A resolved finding is kept 90 days, longer than a gone container’s record. Once the container is no longer on record, its findings keep `location.kind` `container` with `container_uuid` and `image_ref` `null`; `location=container` still lists them, and that container’s uuid answers `404`.

Three filters narrow the list. They combine with the others (`kind`, `kev`, `severity`, `status`, `vulnerability_id`, `package`) by AND:

-   **`location`** is `host` or `container`. `container` leaves out posture checks and compromise indicators.
-   **`container_uuid`** lists the vulnerability findings of one container of the server, and leaves out the other kinds.
-   **`source[]`** lists the vulnerability findings matched from one of the given sources, and leaves out the other kinds.

```plaintext
curl -G https://rest.watchtower15.com/v1/servers/$SERVER_UUID/security-findings \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -d container_uuid=$CONTAINER_UUID \
  -d source[]=runtime \
  -d status[]=open
```

```json
{
  "data": [
    {
      "kind": "vulnerability",
      "uuid": "a4c9e2f1-7b3d-4e8a-9c6f-1d0b5e3a7c28",
      "title": "CVE-2026-129474",
      "package": "openssl",
      "severity": "critical",
      "status": "open",
      "fix_state": "fixed",
      "fixed_version": "3.0.14",
      "location": { "kind": "container", "container_uuid": "6d2f0c1e-8b4a-4f3e-9a71-2c5d8e1f4b90", "image_ref": "shop-api:2.4.1" },
      "source": "runtime"
    }
  ],
  "next_cursor": null
}
```

## List container images

`GET /v1/security/images` returns the images your monitored servers run now, one row per image digest, or per image name when the digest is not known. An archived or paused server, and one whose agent was revoked, is left out, as on the console’s *By image*. Two tags of one digest are one image, listed with both names. A container with neither a digest nor a name is counted in `meta.unidentified_containers`.

-   **`vulnerability_id`** lists only the images that have an open finding of that vulnerability, whichever package carries it; case does not matter. **`severity[]`** (`critical`, `warning` or `info`) and **`kev`** (`true` or `false`) narrow it the same way. The image’s own counts always cover all its open findings.
-   **`search`** (part of any of the image’s names) and **`image_digest`** narrow the list too.
-   **`sort`** is `image_ref` (the default), `server_count`, `last_seen` or `findings`, and **`direction`** is `asc` or `desc`.

An image has `image_digest`, `image_ref` (the newest name seen) and `image_refs` (up to five names), `server_count`, `container_count`, `servers` (up to ten, with their `uuid` and `name`), `findings` (the open vulnerabilities and packages of the image, counted once however many containers carry them) and `last_seen_at`.

```plaintext
curl -G https://rest.watchtower15.com/v1/security/images \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -d vulnerability_id=CVE-2026-129474
```

```json
{
  "data": [
    {
      "image_digest": "sha256:9c4e1f7a2b8d3e6c5a0f9b1d4e7c2a8f6b3d0e9c1a5f7b2d8e4c6a0f3b9d1e7c",
      "image_ref": "shop-api:2.4.1",
      "image_refs": ["shop-api:2.4.1", "shop-api:2"],
      "server_count": 3,
      "container_count": 5,
      "servers": [
        { "uuid": "b1e7c4a9-3d2f-4c8e-a6b1-9f0d2e5c7a43", "name": "vps-worker-1" },
        { "uuid": "e8d3a6c1-5f2b-4a9e-8c7d-0b4f1e6a2c95", "name": "vps-worker-2" },
        { "uuid": "2c9f7e4b-1a6d-4e3c-b8a5-7d0e9f2c4b61", "name": "vps-worker-3" }
      ],
      "findings": { "open": 31, "critical": 4, "warning": 19, "info": 8, "kev": 1 },
      "last_seen_at": 1794563310000
    }
  ],
  "next_cursor": null,
  "meta": { "unidentified_containers": 0 }
}
```

## Example: who runs a vulnerable image

After an advisory, find every image that has it, then each server’s container and the version that fixes it. Rebuild the image on the fixed version; the next daily match resolves the finding once the new container is read.

```plaintext
api=https://rest.watchtower15.com/v1
auth="Authorization: Bearer $WT15_API_KEY"
cve=CVE-2026-129474

curl -sS -G "$api/security/images" -H "$auth" -d vulnerability_id=$cve \
  | jq -r '.data[] | .servers[].uuid' | sort -u \
  | while read server; do
      curl -sS -G "$api/servers/$server/security-findings" -H "$auth" \
        -d vulnerability_id=$cve -d location=container -d status[]=open \
        | jq -r --arg s "$server" '.data[] | [$s, .location.image_ref, .package, .fixed_version] | @tsv'
    done
```

Source: https://developer.watchtower15.com/api/container-vulnerabilities/
