v0.9.0: vulnerabilities on the map; event counts scaled to the window

Vulnerabilities: VulnerabilityReports from operator-trivy are cached
(trimmed to the fields shown) and mapped to cards through the scanned
object in their labels. A card shows a red shield with its CRITICAL CVE
count; the details list CRITICAL and HIGH CVEs with packages, installed
and fixed versions and the advisory link, one row per CVE and image.
Counted per CVE, not per package: openssh's six subpackages had made one
CVE count six times. Kept apart from problems on purpose: on the live
cluster 22 cards have some, which would bury the "is it working" badges.

Fixes, both found on the live cluster, where they made all five current
"problems":
- a Warning event's count is cumulative since its first occurrence; four
  dex-authenticators on xeon had 38-51 probe failures over two days (one
  an hour, pods never left Ready) and were badged as a burst. The count
  is now scaled to the part of the event's lifetime the window covers.
- upmeter's smoke-mini services and pods are its synthetic test, moved
  between nodes on purpose (NoEndpoints, FailedMount while moving).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Виталий Чефанов
2026-09-25 00:50:37 +03:00
co-authored by Claude Opus 5.5
parent c563cd3a2f
commit ce6dad9a58
16 changed files with 531 additions and 22 deletions
+8 -2
View File
@@ -26,11 +26,17 @@ Workloads managed by non-native controllers are included: Advanced DaemonSets of
A card with a problem carries a badge: yellow `!` for a warning, red `!` for an error. Namespace boxes and cards, node boxes and the tree take the colour of the worst problem inside. Sources:
- **Object state**: containers in `CrashLoopBackOff`, `ImagePullBackOff` and similar, recent restarts and OOM kills, pods pending or unschedulable, workloads with no or not all replicas ready for more than 2 minutes, a stuck rollout, a CronJob whose last run failed, a Service with no ready pod, an Ingress routing to a Service that does not exist, a node that is not ready or is under memory, disk or PID pressure.
- **Warning events** of the last 30 minutes, folded per object and reason. Scheduling, volume and back-off failures badge the card at once; any other reason needs five repeats and is listed without a badge before that, so a single failed probe during a restart does not colour the map.
- **Warning events** of the last 30 minutes, folded per object and reason. Scheduling, volume and back-off failures badge the card at once; any other reason needs five repeats inside the window and is listed without a badge before that, so a single failed probe during a restart does not colour the map. An event's count is cumulative since its first occurrence, so a long-lived event is scaled to the window: 40 probe failures over two days is one an hour, not a burst.
- **Prometheus alerts** that Deckhouse mirrors into `ClusterAlert` objects. An alert is attached by its labels (`deployment`, `statefulset`, `daemonset`, `pod`, `service`, `ingress`, `node`, `namespace`); one without an object or namespace goes to the cluster list. `severity_level` 1–3 is an error, 4–6 a warning, 7–9 information.
Information-level entries (a cordoned node, a single ordinary warning) are listed and never badge a card. Problems are recomputed on every map request and the open page refreshes them every minute.
## Vulnerabilities
With operator-trivy installed, a card whose images have CRITICAL CVEs shows a red shield with their number in the bottom-right corner. The details panel lists every CRITICAL and HIGH CVE of the workload's images: the packages it hits, the installed version and the version that fixes it, with a link to the advisory. A CVE counts once per card, however many packages and containers it is found in. Vulnerabilities are shown apart from problems: nearly every image has some, and a badge on each card would hide what is actually broken.
The data comes from the `VulnerabilityReport` objects operator-trivy writes, so only namespaces it scans appear (labelled `security-scanning.deckhouse.io/enabled`), and only the severities its `severities` setting keeps.
## Actions
With `actions.enabled` (the default), the details panel offers:
@@ -75,7 +81,7 @@ History is kept in memory: after a pod restart the windows fill again. The statu
## Security
The web interface reads the cluster through the module's own service account (`d8:cluster-map` ClusterRole): `get`, `list`, `watch` on namespaces, pods, services, nodes, events, deployments, statefulsets, daemonsets, cronjobs, ingresses and Deckhouse `clusteralerts`, `get` and `list` on `metrics.k8s.io` pods and nodes, and `get` on `pods/log`. It never reads Secrets or ConfigMaps and has no write verbs. Changes go through [actions](#actions), which use the viewer's own identity.
The web interface reads the cluster through the module's own service account (`d8:cluster-map` ClusterRole): `get`, `list`, `watch` on namespaces, pods, services, nodes, events, deployments, statefulsets, daemonsets, cronjobs, ingresses, Deckhouse `clusteralerts` and operator-trivy `vulnerabilityreports`, `get` and `list` on `metrics.k8s.io` pods and nodes, and `get` on `pods/log`. It never reads Secrets or ConfigMaps and has no write verbs. Changes go through [actions](#actions), which use the viewer's own identity.
This means **anyone admitted to the web interface sees every namespace and can read container logs**, whatever their own RBAC permissions are; what they can change is limited by their own RBAC. Restrict access with `auth.allowedUserGroups` (and optionally `auth.allowedUserEmails` and `auth.whitelistSourceRanges`).