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:
1 parent
d9083adb5b
commit
3d9a2310bb
35 files changed
+9129
-30
No files matched your search
@@ -120,10 +120,20 @@ export interface DockerVulnProblem {
|
||||
severity: "warning";
|
||||
}
|
||||
|
||||
/** Pure: a warning for each Docker host whose stored scans have critical findings. A host whose summary is unknown says nothing. */
|
||||
export function dockerVulnProblems(integrationId: number, rows: Pick<StateRow, "environmentId" | "environmentName" | "critical" | "high" | "findings">[]): DockerVulnProblem[] {
|
||||
/**
|
||||
* Pure: a warning for each Docker host whose stored scans have critical findings — and, when `highThreshold` is above 0, one for each whose scans have at least that many *high* ones. A host
|
||||
* whose summary is unknown says nothing.
|
||||
*/
|
||||
export function dockerVulnProblems(integrationId: number, rows: Pick<StateRow, "environmentId" | "environmentName" | "critical" | "high" | "findings">[], highThreshold = 0): DockerVulnProblem[] {
|
||||
const out: DockerVulnProblem[] = [];
|
||||
for (const r of [...rows].sort((a, b) => a.environmentName.localeCompare(b.environmentName))) {
|
||||
if (highThreshold > 0 && r.high !== null && r.high >= highThreshold) {
|
||||
out.push({
|
||||
key: `docker-vuln-high:${integrationId}:${r.environmentId}`,
|
||||
severity: "warning",
|
||||
message: `${r.environmentName}: ${r.high} high ${r.high === 1 ? "vulnerability" : "vulnerabilities"} in the scanned images (you asked to hear of ${highThreshold} or more)`,
|
||||
});
|
||||
}
|
||||
if (r.critical === null || r.critical <= 0) continue;
|
||||
const findings = findingsOf(r);
|
||||
const images = [...new Set(findings.map((f) => f.imageName))];
|
||||
|
||||
Reference in new issue
Block a user