Containers
Machines > Containers shows what Docker and Podman run on your machines, the known vulnerabilities in their images, and how the container hosts are set up. It also updates a container to the newest image of its tag, through the same approvals, change windows, change tickets, locks, and audit log as every other change.
What Gardience reads
#On Linux, Gardience reads Docker, Podman run as root, and each user's own (rootless) Podman. On Windows, it reads Docker when it is installed. A machine with no container engine shows nothing here and is not affected in any way.
For each container it records the name, id, image and image id, when it was created, its status, its restart policy, its published ports, and three settings that matter for security: whether it runs privileged, whether it shares the host's network or process list, and whether it mounts an engine socket or a system folder of the host (such as /, /etc, or /var/run/docker.sock). For each image it records the tags, digests, size, and creation date. It reads all of this from the engines' own JSON output.
Gardience never collects a container's environment variables, because they often hold passwords.
The machines are checked every six hours, and when you choose Check now (admins and operators). A machine that joined minutes ago gets Gardience's agent functions during the check and is checked in the same run. Each check is in the audit log.
The page
#The boxes at the top count the machines with a container engine, the running containers, the images with actively exploited CVEs, the images with critical or high CVEs, and the host hardening checks that pass.
Below them, four folding panels:
- Images, open at first. Images with actively exploited CVEs come first, then images with critical or high CVEs, then the other scanned images, then the ones not scanned yet. Choose an image to see its CVEs, with severity, exploit chance, the packages, and the versions that fix them.
- Containers, running and stopped, with the machine, the image, the status, the ports, anything to review (such as privileged or host network), and Update….
- Container hosts, with each machine's engines and versions, how many containers run, its images, how many hardening checks pass, and whether the container scanner is installed.
- Host hardening checks, with the machines each check fails and passes on.
How image vulnerabilities are found
#Gardience uses Trivy, an open-source scanner (Apache-2.0), in two halves:
- On the machine. For each image Gardience has not seen before, one machine that holds it makes the image's package list with Trivy. Trivy runs with no vulnerability database and no network access. Only the package list (names and versions, a few hundred kilobytes compressed) comes to the Gardience server. Image contents never leave the machine.
- On the Gardience server. The server matches each package list against Trivy's vulnerability database.
An image is identified by its image id, a hash of its content, so an unchanged image is never scanned again, however many machines run it. When the server gets a newer database, it matches the package lists it already has again, without asking the machines. At most four machines make package lists at the same time, each up to ten images per round, and the server matches two images at a time.
Windows container images are not scanned.
Install the container scanner
#Machines need Trivy for the first half. On the Containers page, choose Install the container scanner on N machines, or run the built-in runbook Install the container scanner from Automation > Runbooks. It installs one pinned Trivy release into /var/lib/gardience/containers and refuses the file unless its SHA-256 is the one published for that release. The machine gets the file from the Salt master when the Gardience release bundle carries it, and from the Trivy project's GitHub releases otherwise. Like every runbook, it goes through your approvals and change windows.
The vulnerability database
#The Gardience server downloads Trivy's vulnerability database once a day, during a check. It needs HTTPS access to mirror.gcr.io (or ghcr.io). The database is about 1.7 GB once unpacked, so keep 4 GB free on the data volume. Admins can choose Download now on the Containers page.
On a network with no internet, an admin imports the database instead. On a machine that has internet, make the file with either of these:
oras pull mirror.gcr.io/aquasec/trivy-db:2 # saves db.tar.gztrivy image --download-db-only --cache-dir ./trivy-cache
tar czf trivy-db.tar.gz -C ./trivy-cache/db trivy.db metadata.jsonThen choose Import database on the Containers page and pick the file (up to 3 GB). Gardience takes only trivy.db and metadata.json from the archive, refuses links and anything else, and tries the database with Trivy before it replaces the one in use. Every import is in the audit log. Import a fresh copy regularly, as you do CISA's catalog and the EPSS scores.
A FIPS install never downloads the database itself, because Trivy's own TLS is not a validated cryptographic module. Import it as above.
In the CVE tracker
#Container image findings join Security > Vulnerabilities in their own section, Container image findings, apart from the machines' own CVEs. They are labeled that way because the fix is different: the fix is a newer image built with the fixed packages, then updating the containers that run it, not an operating system update.
The section uses the same order as the rest of the tracker: CVEs in CISA's Known Exploited Vulnerabilities catalog first (earliest CISA due date first), then CVEs with a fix, by exploit chance (EPSS) and severity. Each row shows how many images, machines, and containers have the CVE, the images by name, and the versions that fix it.
Look up a CVE lists the images that have it below the machines, with the machines and containers that run each image. Download CSV has a row for each machine, image, and CVE, with three more columns at the end: finding_type (operating system or container image), image, and containers. For container image rows, packages_or_updates names the packages with their installed versions and the versions that fix them.
When a check finds an actively exploited CVE in an image for the first time, Gardience raises an urgent alert once.
Host hardening checks
#These are checks in the style of the CIS Docker Benchmark that Gardience can read safely. They are not a full benchmark assessment, and passing them does not make a host compliant with the benchmark on its own.
| Check | Passes when |
|---|---|
| CTR-01 Docker socket | /var/run/docker.sock is owned by root, its group is root or docker, and others cannot write to it |
| CTR-02 Docker settings file | /etc/docker/daemon.json is owned by root and only root can write to it |
| CTR-03 Privileged containers | No running container is privileged |
| CTR-04 Host network | No running container shares the host network (a few monitoring agents need it: review each one) |
| CTR-05 Host processes | No running container shares the host process list |
| CTR-06 Sensitive mounts | No running container mounts an engine socket or a system folder of the host |
| CTR-07 Live restore | Containers keep running while Docker restarts ("live-restore": true) |
| CTR-08 User namespaces | User namespace remapping is on (userns-remap) |
| CTR-09 New privileges | Containers cannot gain new privileges by default ("no-new-privileges": true) |
| CTR-10 Logging | The logging driver is on, and local json-file logs have a size limit (log-opts max-size) |
| CTR-11 Traffic between containers | Traffic between containers on the default network is restricted ("icc": false) |
| CTR-12 Content trust | DOCKER_CONTENT_TRUST=1 is set for the system |
| CTR-13 Audit rules | auditd has rules for dockerd, /var/lib/docker, /etc/docker, Docker's systemd units, and daemon.json |
On a Podman host, CTR-03 to CTR-06 apply to its containers; the others do not apply (Podman has no daemon). A check with no running containers to look at does not apply either.
Gardience does not change these settings for you. Most of them are Docker daemon settings, and changing them restarts Docker and its containers, so plan the change in a change window.
Update a container
#- On the Containers page, open Containers and choose Update… on the container.
- Gardience asks the machine what the update would do. Nothing changes yet. The window shows the image, the current digest, the newest digest the registry offers (when the machine can ask the registry), how the container would be recreated, and the steps.
- To move to another tag, for example one whose packages fix the CVEs, type it under Move to another tag and choose the button again to see the new plan.
- Choose Update to the newest image, or Pull the newest image only.
The update runs the built-in runbook Update a container to the newest image through the normal run path: your role, approvals (Settings > Approvals), change tickets, change windows, locks, and the audit log. When it finishes, Gardience checks that machine's containers again, so the new image is listed and scanned right away.
How the container is recreated:
| Container | What Gardience does |
|---|---|
| A Docker Compose service | docker compose pull and docker compose up -d --no-deps for that service, in its project folder, with its Compose files (from the labels Compose puts on the container) |
| A Podman container started by a systemd unit | Pulls the image and restarts the unit, which recreates the container |
| Any other Docker or Podman container | Pulls the image, stops the container and keeps it under the name NAME-gardience-old, creates the new one with the same settings, and removes the old one once the new one stays up |
If the new container does not start, stops, or reports unhealthy, Gardience removes it and puts the old container back under its own name. If the pulled image is the one the container already runs, nothing is recreated.
For a plain Docker container, Gardience carries over the name, environment, labels, published ports, restart policy, network and network aliases, bind mounts and volumes (unnamed volumes are reused, so no data is left behind), memory and CPU limits, capabilities, security options, logging settings, and the command and entrypoint when they differ from the image's. For Podman, it reuses the command Podman recorded when the container was created.
Gardience refuses to recreate a container when it cannot carry a setting over exactly, and says which setting. In those cases Pull the newest image only is offered: the image is pulled and nothing else changes, so the container keeps running its current image until you recreate it yourself. Gardience refuses when the container:
- was started from an image id, or is pinned to one digest and you did not choose a tag
- belongs to Docker Swarm or Kubernetes, which would undo the change (no pull either)
- is a Compose service and you chose a new tag (change the tag in the Compose file instead)
- is a Compose service whose project folder or Compose files are not on the machine
- is part of a Podman Compose project, or a rootless Podman container with a systemd unit
- uses devices, GPUs, sysctls, ulimits, links, another container's network or process list, a fixed IP or MAC address, its own health check, a volume plugin, or another setting Gardience does not carry over
- was started by Podman in the foreground, or Podman did not record how it was created
Updating containers on Windows is not supported yet.
Who can do what
#| Action | Who |
|---|---|
| See the page, an image's CVEs, and the CVE tracker's container section | Anyone signed in, limited to their node groups |
| Check now, install the container scanner | Admins and operators |
| See what an update would do, request an update or a pull | Roles that can make changes, on machines in their node groups |
| Import or download the vulnerability database | Admins |
Checks, imports, downloads, update plans, and updates are all in the audit log.