Runbooks per alert kind, high-vulnerability threshold, wall display extras

A "What to do" note (text and/or link) can be written once for a whole kind of alert and
shows beside every alert of that kind; alerts now carry their kind and source type.
New optional setting: warn when a Docker host has N or more high vulnerabilities (off by
default). The wall display gains tiles (Hetzner and game servers running, critical
vulnerabilities, stuck downloads) and a summary line for each group of integrations,
also in share links. Migration 0074; docs and tests included.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-27 21:15:45 +01:00
1 parent d9083adb5b
commit 3d9a2310bb
35 files changed
+9129 -30

No files matched your search

+17 -3
View File
@@ -15,6 +15,7 @@ import TableToolbar from "../components/TableToolbar";
import SilenceButton from "../components/SilenceButton";
import RunPlaybookButton from "../components/RunPlaybookButton";
import RunbookEntry from "../components/RunbookEntry";
import AlertKindRunbookEntry from "../components/AlertKindRunbook";
import AckDrawer, { ackWords } from "../components/AckDrawer";
import CloseDrawer, { CloseBulkDrawer } from "../components/CloseDrawer";
import SnoozeDrawer, { SnoozeBulkDrawer, snoozeWords } from "../components/SnoozeDrawer";
@@ -202,6 +203,18 @@ function AlertsNow({ user, tabs }: { user: CurrentUser; tabs: React.ReactNode })
const withTicket = (report?.alerts ?? []).filter((a) => ids.has(a.id) && a.ticket?.number && !a.ticket.closedAt);
return { closable: withTicket.filter((a) => a.ticket?.canClose).map((a) => a.ticket!.number as string), other: withTicket.filter((a) => !a.ticket?.canClose).length };
}, [pickedIds, report]);
// "Add what to do" is offered once for each kind of alert on the page (on the first of them), not beside every one; what has been written shows beside all of them.
const firstOfKind = useMemo(() => {
const seen = new Set<string>();
const first = new Set<string>();
for (const a of pageItems ?? []) {
if (!seen.has(a.kind)) {
seen.add(a.kind);
first.add(a.id);
}
}
return first;
}, [pageItems]);
const shownIds = useMemo(() => (sorted ?? []).filter((a) => !a.silenced).map((a) => a.id), [sorted]);
const allShownPicked = shownIds.length > 0 && shownIds.every((id) => picked.has(id));
function togglePicked(id: string) {
@@ -536,9 +549,10 @@ function AlertsNow({ user, tabs }: { user: CurrentUser; tabs: React.ReactNode })
<Link to={incidentPath(a.incidentId)}>Timeline</Link>
</div>
)}
{a.target && (
<div>
<RunbookEntry targetType={a.target.type} targetId={a.target.id} targetName={a.target.name} canEdit={canSilence} forCategory={a.category} />
{(a.target || a.kind) && (
<div className="d-flex flex-wrap gap-3">
{a.target && <RunbookEntry targetType={a.target.type} targetId={a.target.id} targetName={a.target.name} canEdit={canSilence} forCategory={a.category} />}
{a.kind && <AlertKindRunbookEntry kind={a.kind} canEdit={canSilence} offerAdd={firstOfKind.has(a.id)} />}
</div>
)}
{a.affects && a.affects.length > 0 && (
+8 -1
View File
@@ -109,7 +109,14 @@ export default function DockerVulnerabilities({ integrationId }: { integrationId
From the scans Dockhand has already run on its images (it scans when it is told to — nothing is scanned from here). An image that was never scanned is not known to be clean.{" "}
{data.alerts ? (
<>
<strong>Critical</strong> findings are an alert — see <Link to="/alerts">Alerts</Link>; high, medium and low are only shown here.
<strong>Critical</strong> findings are an alert — see <Link to="/alerts">Alerts</Link>;{" "}
{data.highThreshold > 0 ? (
<>
so is a host with <strong>{data.highThreshold} or more high</strong> ones (<Link to="/settings/notifications">Settings → Notifications</Link>); medium and low are only shown here.
</>
) : (
<>high, medium and low are only shown here (high ones can be alerted from a number you choose under Settings → Notifications).</>
)}
</>
) : (
<>
+2
View File
@@ -88,6 +88,8 @@ export default function SharedWall() {
alerts: wall ? wall.alerts : null,
maintenance: wall?.maintenance ?? 0,
integrationsFailing: wall ? wall.integrationsFailing : null,
tiles: wall?.tiles,
groups: wall?.groups,
problems: wall?.problems ?? null,
windows: wall?.maintenanceWindows ?? null,
integrations: (wall?.integrations as WallData["integrations"]) ?? null,
+7 -2
View File
@@ -1,6 +1,6 @@
import { useEffect, useState } from "react";
import { Link, useNavigate } from "react-router-dom";
import { api, type IntegrationSummary, type MaintenanceWindow, type ServerSummary } from "../api/client";
import { api, type IntegrationSummary, type MaintenanceWindow, type ServerSummary, type WallGroup, type WallTile } from "../api/client";
import { alertBadge, useAlertsReport } from "../hooks/useAlertsReport";
import { useEnvironment } from "../utils/environment";
import WallView, { REFRESH_MS, wallHeadline, type WallData } from "../components/WallView";
@@ -16,6 +16,7 @@ export default function Wall() {
const [servers, setServers] = useState<ServerSummary | null>(null);
const [integrations, setIntegrations] = useState<IntegrationSummary[] | null>(null);
const [windows, setWindows] = useState<MaintenanceWindow[]>([]);
const [extras, setExtras] = useState<{ tiles: WallTile[]; groups: WallGroup[] } | null>(null);
const [updatedAt, setUpdatedAt] = useState<Date | null>(null);
const [idle, setIdle] = useState(false);
@@ -23,11 +24,13 @@ export default function Wall() {
let alive = true;
const load = () => {
reload();
Promise.allSettled([api.servers.summary(), api.integrations.list(), api.maintenance.list()]).then(([s, i, m]) => {
Promise.allSettled([api.servers.summary(), api.integrations.list(), api.maintenance.list(), api.wall.extras()]).then(([s, i, m, x]) => {
if (!alive) return;
if (s.status === "fulfilled") setServers(s.value);
if (i.status === "fulfilled") setIntegrations(i.value.integrations);
if (m.status === "fulfilled") setWindows(m.value.windows);
// The extras are only an addition: a board that cannot get them shows the rest.
if (x.status === "fulfilled") setExtras(x.value);
setUpdatedAt(new Date());
});
};
@@ -72,6 +75,8 @@ export default function Wall() {
alerts: report ? { critical: report.counts.critical, warning: report.counts.warning } : null,
maintenance: windows.length,
integrationsFailing: integrations ? failing.length : null,
tiles: extras?.tiles,
groups: extras?.groups,
problems: active.map((a) => ({ id: a.id, severity: a.severity as "critical" | "warning", message: a.message })),
windows: windows.map((w) => ({ id: w.id, name: w.targetName, endsAt: w.endsAt })),
integrations: (integrations ?? [])
@@ -84,7 +84,7 @@ const DIGEST_DAYS: { value: number; label: string }[] = [
{ value: 6, label: "Saturday" },
{ value: 0, label: "Sunday" },
];
const DEFAULT_HEALTH_CHECKS: HealthCheckSettings = { serverOfflineMinutes: 60, diskUsagePercent: 90, domainWarnDays: 30, diskForecastDays: 14, backupStaleHours: 48, restoreTestDays: 0, newPortAlerts: true, flapRaises: 3, deviceOfflineMinutes: 10, osSupportWarnDays: 90, baselineAlerts: true, containerAlerts: true, vulnerabilityAlerts: true, containerIgnore: [] };
const DEFAULT_HEALTH_CHECKS: HealthCheckSettings = { serverOfflineMinutes: 60, diskUsagePercent: 90, domainWarnDays: 30, diskForecastDays: 14, backupStaleHours: 48, restoreTestDays: 0, newPortAlerts: true, flapRaises: 3, deviceOfflineMinutes: 10, osSupportWarnDays: 90, baselineAlerts: true, containerAlerts: true, vulnerabilityAlerts: true, vulnerabilityHighThreshold: 0, containerIgnore: [] };
const DEFAULT_MONTHLY: MonthlyReportSettings = { enabled: false, quarterly: false, annual: false, day: 1, time: "08:00" };
type TestResult = { ok: boolean; message: string } | null;
@@ -904,11 +904,22 @@ export default function NotificationSettings() {
<span className="form-check-label">
Warn about critical vulnerabilities in Docker images
<span className="form-hint d-block">
From the scans Dockhand has already run (nothing is scanned from here): a warning for each Docker host whose scanned images have one or more critical findings. High, medium and low findings are shown on the Docker
page but never alerted. Dockhand can send its own vulnerability notifications too; with both switched on you hear twice.
From the scans Dockhand has already run (nothing is scanned from here): a warning for each Docker host whose scanned images have one or more critical findings. Medium and low findings are shown on the Docker
page but never alerted (high ones only if you set a number below). Dockhand can send its own vulnerability notifications too; with both switched on you hear twice.
</span>
</span>
</label>
<div className="mt-3">
<NumberField
label="Also warn when a Docker host has this many high vulnerabilities"
value={healthChecks.vulnerabilityHighThreshold}
min={0}
max={10000}
unit="or more (0 = never)"
hint="Off by default: scanners find high-severity issues in almost every image, so a low number is noise. Counted over the scanned images of each host, as Dockhand reports them; the critical ones are alerted either way while the box above is ticked."
onChange={(v) => setHealthChecks((h) => ({ ...h, vulnerabilityHighThreshold: v }))}
/>
</div>
</div>
</div>
</div>