Dockhand vulnerability scans: warn about critical findings, with a setting to turn it off
Reads what Dockhand's scans have already stored (never starts one) every 15 minutes and raises a warning per Docker host with critical findings. Unknown counts and stale readings are held, not treated as clean. Settings -> Notifications has a switch (on by default); the Docker page shows counts, scan coverage and the critical findings; /metrics and docs updated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
65214f6f0f
commit
5a2b320175
25 files changed
+8527
-12
No files matched your search
+19
-2
@@ -23,7 +23,7 @@ what the app actually creates.
|
||||
|---|---|
|
||||
| **File** | `DATABASE_PATH`, default `../data/homelab-manager.sqlite` (relative to `server/`; `/app/data/...` in Docker). The folder is created if missing. |
|
||||
| **Foreign keys** | Switched on for every connection (`PRAGMA foreign_keys = ON`), so the `ON DELETE` rules below are enforced. |
|
||||
| **Migrations** | SQL files in [`server/drizzle/`](server/drizzle) (`0000` … `0066`), applied automatically when the server starts. Which ones have run is recorded in the table `__drizzle_migrations`. |
|
||||
| **Migrations** | SQL files in [`server/drizzle/`](server/drizzle) (`0000` … `0067`), applied automatically when the server starts. Which ones have run is recorded in the table `__drizzle_migrations`. |
|
||||
| **Tables** | 78 application tables, plus drizzle's own `__drizzle_migrations`. |
|
||||
|
||||
**Not in the database, but beside it in the data folder:** the backups of the database itself (`backups/homelab-manager-….sqlite`, taken daily and on request; see [BACKUP.md](BACKUP.md)), and, only while a restore is waiting or has just happened, `restore-pending.sqlite` / `restore-pending.json` and `restore-result.json`.
|
||||
@@ -73,6 +73,7 @@ erDiagram
|
||||
integrations ||--o| prometheus_state : "cascade"
|
||||
integrations ||--o| immich_state : "cascade"
|
||||
integrations ||--o| nextcloud_state : "cascade"
|
||||
integrations ||--o{ dockhand_vulnerabilities : "cascade"
|
||||
integrations ||--o| netbox_state : "cascade"
|
||||
integrations ||--o| n8n_state : "cascade"
|
||||
integrations ||--o| paperless_state : "cascade"
|
||||
@@ -889,6 +890,22 @@ How a Nextcloud (an integration of type `nextcloud`) is right now, one row each,
|
||||
| `setup_issues` | text | JSON: name, severity (`error` or `warning`), text — its other setup checks that report a problem, at most 40. Null when the checks could not be asked. |
|
||||
| `updated_at` | text NOT NULL | ISO. |
|
||||
|
||||
#### `dockhand_vulnerabilities`
|
||||
|
||||
What Dockhand's own stored vulnerability scans add up to for each of its Docker hosts (its *environments*), as last read — one row for each Dockhand integration and environment, replaced at every read (every fifteen minutes; a host Dockhand no longer lists is dropped). `integration_id` is a foreign key with **cascade**; the primary key is (`integration_id`, `environment_id`). Nothing is scanned by this app — it reads only what Dockhand kept.
|
||||
|
||||
| Column | Type | Notes |
|
||||
|---|---|---|
|
||||
| `integration_id` | integer PK | |
|
||||
| `environment_id` | integer PK | Dockhand's own id for the Docker host. |
|
||||
| `environment_name` | text NOT NULL | |
|
||||
| `critical`, `high`, `medium`, `low` | integer | The counts across the host's scanned images. **Null when the count could not be read** (an older Dockhand, a host it cannot reach) — which is not the same as 0. |
|
||||
| `images_scanned`, `total_images` | integer | How many of the host's images have a scan; the rest are not known to be clean. |
|
||||
| `findings` | text NOT NULL, default `[]` | JSON: the critical findings (CVE, package, installed and fixed version, image, the containers that use it), at most 100. |
|
||||
| `updated_at` | text NOT NULL | ISO. |
|
||||
|
||||
How the last read went is kept in `settings`, key `_internal:dockerVulnSync`.
|
||||
|
||||
#### `netbox_state`
|
||||
|
||||
How a NetBox (an integration of type `netbox`) is right now, one row each, replaced at every read (every five minutes). `integration_id` is the primary key and a foreign key with **cascade**.
|
||||
@@ -1349,7 +1366,7 @@ that were never changed aren't stored; the app fills in defaults when reading.
|
||||
| `inventory` | `currency` (a short name, may be blank) and `pricePerKwh` (null) — what the inventory's running cost is worked out with. |
|
||||
| `monthlyReport` | The monthly report: `enabled` (false), `day` (1–28, default 1) and `time` (`HH:MM`, default `08:00`), in the notification time zone; `quarterly` and `annual` (both false) add the quarter's report after March, June, September and December, and the year's after December. |
|
||||
| `digest` | The weekly digest: `enabled` (false), `day` (0 = Sunday … 6; default 1, Monday) and `time` (`HH:MM`, default `08:00`), in the notification time zone. |
|
||||
| `healthChecks` | `restoreTestDays` (0 = off — how long a guest's last passing restore test counts; a failed one is always raised), `serverOfflineMinutes` (60), `diskUsagePercent` (90), `domainWarnDays` (30), `diskForecastDays` (14; 0 = off — how far ahead a filling disk is flagged on the Alerts page), `backupStaleHours` (48; 0 = off — how old a Proxmox guest's newest backup may be), `newPortAlerts` (true — warn when a server starts listening on a TCP port that is not in its baseline and not noted), `flapRaises` (3; 0 = off — raises of one alert within an hour that make it "flapping" so its messages are held; see NOTIFICATIONS.md), `deviceOfflineMinutes` (10 — how long a UniFi device may be offline before it is raised), `osSupportWarnDays` (90; 0 = off), `baselineAlerts` (true — warn when CPU or memory over the last hour is far above what the server's own history says is normal for this hour of the week; see docs/MONITORING.md), `containerAlerts` (true — warn when a Docker container is broken) and `containerIgnore` (a list of container names or `host/name`, `*` allowed, to leave alone). The baselines themselves are not stored: they are worked out from `server_metrics_rollup` (hourly rows, `grain = 'h'`) when needed. A server can override each of these (see `servers.thresholds`). |
|
||||
| `healthChecks` | `restoreTestDays` (0 = off — how long a guest's last passing restore test counts; a failed one is always raised), `serverOfflineMinutes` (60), `diskUsagePercent` (90), `domainWarnDays` (30), `diskForecastDays` (14; 0 = off — how far ahead a filling disk is flagged on the Alerts page), `backupStaleHours` (48; 0 = off — how old a Proxmox guest's newest backup may be), `newPortAlerts` (true — warn when a server starts listening on a TCP port that is not in its baseline and not noted), `flapRaises` (3; 0 = off — raises of one alert within an hour that make it "flapping" so its messages are held; see NOTIFICATIONS.md), `deviceOfflineMinutes` (10 — how long a UniFi device may be offline before it is raised), `osSupportWarnDays` (90; 0 = off), `baselineAlerts` (true — warn when CPU or memory over the last hour is far above what the server's own history says is normal for this hour of the week; see docs/MONITORING.md), `containerAlerts` (true — warn when a Docker container is broken), `vulnerabilityAlerts` (true — warn when Dockhand's scans found critical vulnerabilities; an older stored setting without it counts as on) and `containerIgnore` (a list of container names or `host/name`, `*` allowed, to leave alone). The baselines themselves are not stored: they are worked out from `server_metrics_rollup` (hourly rows, `grain = 'h'`) when needed. A server can override each of these (see `servers.thresholds`). |
|
||||
| `logRetention` | `enabled`, `retentionDays` (90), `intervalHours` (24). |
|
||||
| `display` | `dateFormat`, `timeFormat`, `pageSize`. |
|
||||
| `providerColors`, `integrationColors` | Badge colours, by provider / integration type. |
|
||||
|
||||
Reference in new issue
Block a user