Image Vulnerability Scanning
DockPanel can scan every Docker app’s image against Anchore’s grype vulnerability database, surface a severity badge next to each app, and optionally refuse deploys on images that exceed a CVE threshold.
Scanning is disabled by default. Existing installs see no behaviour change after upgrade — admins opt in from the Settings UI.
Enable
- Go to Settings → Services → Image Vulnerability Scanning.
- Click Install Scanner. DockPanel downloads grype (~70 MB) into
/var/lib/dockpanel/scanners/, primes the CVE database, and registers it with the agent. This is self-contained — nothing is written to/usr/local/bin, and the database lives inside the agent’s sandbox. - (Optional) Toggle Enable scheduled scans to let the background sweeper rescan every running app’s image at the configured interval (default 24 h, range 1 – 720).
- (Optional) Toggle Scan on deploy and pick a Deploy-gate threshold —
critical,high, ormedium. Leave atnoneto observe without blocking.
What the Apps page shows
Each running app row shows two badges next to its name:
- Update — an image tag is behind the registry.
- CVE — the latest scan’s highest-severity count (critical/high/medium/low). Hover for exact counts; click the row to open the drawer.
The drawer lists every vulnerability from the latest scan: CVE ID, severity, affected package, installed version, and the fixed version (if one is available upstream). Click Scan Now to force an immediate rescan.
Deploy gate
When the deploy gate is set to critical, high, or medium, every door that puts an image on a host checks it against the latest stored scan for that host — deploying a template, changing an app’s image, deploying a compose file, and creating or editing a stack (each service in the file is checked):
- If the last scan is within the past 7 days and exceeds the threshold, the deploy is refused with a clear message naming the counts and the image.
- If no recent scan exists, the deploy is allowed and a best-effort background scan starts. The next attempt of the same image will be gated.
The gate is intentionally soft on first contact — it never blocks the very first deploy of an image on a cold database, so operators aren’t stuck waiting 30–180 s on a blocking scan the first time they use a template.
Updating an app is deliberately exempt. Update re-pulls the reference the app already runs, so the only scan on file is a scan of the image being replaced. Gating on it would refuse the update exactly when the running image is vulnerable — which is the update that fixes it. The background sweep rescans the new image afterwards, and the badge on the Apps page reflects it.
API
All endpoints require admin auth.
| Method | Path | Purpose |
|---|---|---|
GET | /api/image-scan/settings | Current toggles + installed state |
PUT | /api/image-scan/settings | Update toggles |
POST | /api/image-scan/install | Install grype + prime DB |
POST | /api/image-scan/uninstall | Remove grype + DB |
POST | /api/image-scan/scan | Ad-hoc scan of {"image": "..."} |
POST | /api/apps/:name/scan | Scan the image used by a specific app |
GET | /api/apps/:name/scan | Latest stored scan for an app’s image |
GET | /api/image-scan/recent | Latest row per scanned image |
Alerts
A critical or high-severity finding fires an image_scan alert to every administrator, keyed per image so unrelated images never resolve or suppress each other’s alert. It clears itself automatically the next time that image scans clean — no manual acknowledgement needed. Mute or route it like any other alert type from Settings → Notifications.
Storage
Scan results are stored in the image_scan_findings table. Per image, only the most recent 30 scans are retained; older rows are trimmed after each scan to keep the table lean.
The grype binary lives at /var/lib/dockpanel/scanners/grype and its vulnerability database at /var/lib/dockpanel/scanners/grype-db. Uninstalling from the UI removes both.
Relationship to the full-server security scan
This is distinct from the weekly full-server security scan (Settings → Security → Security Scans), which aggregates container vuln counts into a single server-wide report. Image scanning drills into each image individually so you can act on a specific app.