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:
bobbanandClaude Sonnet 5.5 committed 2026-10-25 22:34:06 +01:00
1 parent 65214f6f0f
commit 5a2b320175
25 files changed
+8527 -12

No files matched your search

+34
View File
@@ -539,6 +539,7 @@ export interface HealthCheckSettings {
baselineAlerts: boolean;
/** A container that keeps restarting, is unhealthy, stopped unexpectedly or never started, and a Docker host that cannot be reached, is an alert. */
containerAlerts: boolean;
vulnerabilityAlerts: boolean;
/** Containers to leave alone: a name, or "host/name"; * stands for anything. */
containerIgnore: string[];
}
@@ -2517,6 +2518,38 @@ export interface DockhandContainer {
leftAlone?: boolean;
}
export interface DockhandVulnFinding {
cve: string;
severity: string;
package: string | null;
installedVersion: string | null;
fixedVersion: string | null;
imageName: string;
containers: string[];
}
export interface DockhandVulnerabilityEnvironment {
environmentId: number;
environmentName: string;
critical: number | null;
high: number | null;
medium: number | null;
low: number | null;
imagesScanned: number | null;
totalImages: number | null;
/** The critical findings (at most 100). */
findings: DockhandVulnFinding[];
updatedAt: string;
}
export interface DockhandVulnerabilitiesResponse {
/** Whether critical findings are alerted (Settings → Notifications). */
alerts: boolean;
status: { at: string; ok: boolean; error: string | null } | null;
fresh: boolean;
environments: DockhandVulnerabilityEnvironment[];
}
export interface DockhandContainersResponse {
/** Docker hosts Dockhand could not read this time. */
unreachable?: { environmentId: number; environmentName: string; error: string }[];
@@ -3448,6 +3481,7 @@ export const api = {
dockhand: {
containers: (integrationId: number) =>
request<DockhandContainersResponse>(`/api/integrations/${integrationId}/dockhand/containers`),
vulnerabilities: (integrationId: number) => request<DockhandVulnerabilitiesResponse>(`/api/integrations/${integrationId}/dockhand/vulnerabilities`),
leaveAlone: (integrationId: number, environmentName: string, name: string, leaveAlone: boolean) =>
request<{ containerIgnore: string[] }>(`/api/integrations/${integrationId}/dockhand/leave-alone`, { method: "PUT", body: JSON.stringify({ environmentName, name, leaveAlone }) }),
start: (integrationId: number, envId: number, containerId: string) =>