Vulnerability scanning
Scan images on any host for known CVEs with the Grype CLI, on demand.
Dockmesh scans container images with Grype. Grype isn’t bundled. Dockmesh runs the grype binary on the server as a subprocess and stores the summarised result.
Install Grype
Section titled “Install Grype”scripts/install.sh installs a pinned Grype release, checked against its SHA-256, on a fresh install and on upgrades where grype isn’t on the host yet. An existing grype binary is kept. To skip it, set DOCKMESH_NO_SCANNER=1:
curl -fsSL https://get.dockmesh.dev | sudo DOCKMESH_NO_SCANNER=1 bashIf you skipped it, or run Dockmesh from the repository’s Dockerfile (the image doesn’t contain Grype), install Grype yourself so the server process can run it. See Installation.
Configuration
Section titled “Configuration”| Variable | Default | Purpose |
|---|---|---|
DOCKMESH_SCANNER_ENABLED | true | The default for the Scan images with Grype switch; it only counts until a value is saved there |
DOCKMESH_SCANNER_BINARY | grype | Name or path of the Grype binary |
Both are read at startup. If the binary can’t be found, the server logs a warning and scan requests return 503 until Grype is installed; no restart is needed.
The Scan images with Grype switch under Settings → General turns scanning on and off at once. While it’s off, scan requests return 503 and stored reports stay visible. The system health check shows the state a scan would find: Grype ready, disabled, or enabled with the binary missing.
Grype’s database and network access
Section titled “Grype’s database and network access”Grype keeps its vulnerability database in the grype-db folder of the data directory (set GRYPE_DB_CACHE_DIR for another place), left out of system backups, and updates it itself; the first scan downloads the database and takes longer. Dockmesh has no settings for the database. Updating it contacts Anchore’s servers on the internet. Grype’s own check for a newer Grype release is off unless you set GRYPE_CHECK_FOR_APP_UPDATE=true. To control this, set Grype’s own environment variables (for example GRYPE_CHECK_FOR_APP_UPDATE=false) in the environment of the Dockmesh service; the subprocess inherits them. See Security hardening for the outbound connections Dockmesh makes.
Run a scan
Section titled “Run a scan”Scans run only when you start them:
- On an image’s page, click Scan now (or Re-scan) on the Vulnerabilities tab.
- Under Resources → Images, click the scan button in an image’s Vulnerabilities column, or Scan all to scan every image in the list one after another.
- Through the API:
POST /api/v1/images/{id}/scan. The latest result is returned byGET /api/v1/images/{id}/scan.
Scanning needs images.scan on the host the image is on. A scan runs inside the HTTP request and Grype times out after 5 minutes. Results are stored per host and image reference (the image’s first repository:tag), because the same tag can be different content on two hosts.
There are no scheduled scans and no scans on pull or deploy.
Grype only runs on the server. An image on the server host is read from its Docker engine. An image on an agent host is sent to the server as an archive for the scan, up to 20 GiB, kept in the scan-tmp folder of the data directory until the scan ends, and left out of system backups. Such scans run one at a time, and the scan stops with an error if less than 1 GiB of disk space would stay free. Agents need no scanner. Scanning on an agent host needs the agent version that ships with this server; an older agent refuses with a message to update it from the Hosts page.
Results
Section titled “Results”The report lists each finding with its CVE ID, severity (critical, high, medium, low, negligible, unknown), affected package and version, and the fixed version if there is one. The Vulnerabilities column of the images list shows the counts per severity, and the CVE filter shows only images with findings.
Each scan is written to the audit log as image.scan with the critical and high counts. When a scan finds critical or high findings, Dockmesh posts a cve.found bell notification to users with images.view on that host. It isn’t sent to notification channels. See Notifications.
There’s no way to suppress or accept individual findings, and no fleet-wide report export. Grype only finds packages it can identify from image metadata. Treat a clean scan as a baseline, not proof.
See also Images and Image updates.