From CVE counts to a daily to-do list

Which open source scanners exist for Kubernetes, why Kubescape is the one that knows which CVEs are actually loaded, why its own metrics stop at counts, and how a small exporter and one Grafana dashboard turned that into a list of what to fix today.

In this post
  1. Why counting CVEs is not enough
  2. Starting from Kubescape
  3. Exporting the scan reports
  4. From metrics to a to-do list
  5. Wrapping up

Every image scanner tells you that you have hundreds of CVEs. That number never goes down, so after a week nobody looks at it anymore.

This post is the long version of how we got out of that for our Kubernetes platform: what is out there, why we ended up with Kubescape, what Kubescape gives you out of the box, where that stops, and how a small exporter of our own and one Grafana dashboard turned the same data into a list we actually work through.

Why counting CVEs is not enough

The problem, and the question

We run three Exoscale SKS clusters (tool, lab and prod), all monitored from one central Prometheus and Grafana. Platform components, customer sites, a few AI workloads on GPU nodes. Lots of images we did not build ourselves.

Scanning those images is easy: any scanner will happily give you a list. As a work queue, that list is useless:

  • A Go binary that embeds an old stdlib shows up with a dozen CVEs, most of them in code paths the binary never touches.
  • A base image ships busybox, ncurses and perl because that is what base images do. The application never starts any of them.
  • Half of the critical CVEs have no fix yet, so there is nothing to do except feel bad.
  • And a critical CVE in a pod that nothing outside the cluster can reach is a different kind of problem than the same CVE behind a public hostname.

So the question we actually have is smaller than “what is vulnerable”:

Which of these CVEs can hurt us, and what do we fix today?

To answer that, a scanner has to know more than what is in an image. It has to know what is used, whether it is being exploited in the wild, and whether the workload can be reached. Most of this post is about where each of those answers comes from.

What is out there

There are a lot of open source tools for “Kubernetes security scanning”, and it gets confusing, because tools with similar names do very different things. Roughly, they fall into five groups.

Image and SBOM scanners. They read the packages in an image (or in an SBOM) and match them against vulnerability databases. Trivy (Aqua Security) and Grype with its SBOM generator Syft (Anchore) are the big two; Google’s OSV-Scanner and Red Hat’s Clair are others. None of these are CNCF projects, but everything else builds on them.

Registry scanning. Harbor (CNCF graduated) can scan every image on push and on a schedule, with Trivy built in. Great for “what is in our registry”, but it has no idea what runs where.

In-cluster scanners. Operators that look at what is running and scan that. Trivy Operator writes a VulnerabilityReport per workload. Kubescape (CNCF incubating) does image scanning, configuration posture (CIS, NSA, MITRE) and, with its node-agent, runtime observation.

Full platforms. NeuVector is the odd one out: a complete container security platform that SUSE open sourced in 2022 (not a CNCF project). It scans images in registries, running containers and the nodes themselves, learns the normal processes and network connections of every workload and can then block anything else, has its own layer 7 firewall, admission control and CIS checks, all behind its own UI.

Runtime detection and enforcement. Falco (CNCF graduated), Cilium’s Tetragon and KubeArmor (CNCF sandbox) watch system calls with eBPF and alert on, or block, suspicious behaviour. They do not deal with CVEs at all: they catch someone using one.

Policy and inventory. Kyverno and OPA Gatekeeper stop bad configuration at admission, kube-bench checks nodes against the CIS benchmark, and Dependency-Track (OWASP) keeps an inventory of SBOMs and tracks their CVEs over time.

What they actually do differently

Put next to each other, the difference is mostly when they look and what they know when they do:

Tool Looks at When Knows what runs Knows what is loaded
Trivy, Grype, OSV-Scanner an image, a filesystem or an SBOM build, CI no no
Harbor (Trivy) every image in the registry push, schedule no no
Trivy Operator the images of running workloads continuously yes no
Dependency-Track SBOMs you upload continuously only if you feed it no
Falco, Tetragon, KubeArmor system calls runtime yes yes, but not about CVEs
NeuVector registry, running images, nodes, runtime behaviour continuously yes yes, but not used for CVEs
Kubescape running images and their runtime behaviour continuously yes yes

The scanners at the top are the right tool in CI: fail the build on a critical CVE with a fix, done. They just cannot tell you which of the 200 CVEs in a running image matter, because they never see the image run.

The runtime tools see everything that runs, but they answer a different question (“is someone attacking us right now”), not “which CVE do I fix first”.

NeuVector comes closest to having both halves. It knows what every container runs, down to processes and connections, and it scans every running image and node. But as far as we could find, the two do not meet: a CVE is reported for the image whether its package is ever loaded or not. And it is a whole platform with its own UI, controllers and privileged enforcers on every node, overlapping with things we already do with Cilium network policies and Kyverno. For “which CVEs matter” that is a lot of platform to adopt.

Kubescape is the one that combines the two. Its node-agent uses eBPF to record which files every container opens while it runs. Its kubevuln component matches the image’s SBOM against the Grype database, and then filters the result down to the packages whose files were actually opened. Kubescape calls those CVEs relevant. As far as we could find, it is the only open source tool that does this. Commercial platforms tend to have it in some form, and it is usually one of the features that sells them.

On a typical image it throws away most of the list. That is exactly the noise we wanted gone, so we picked Kubescape. The Helm values that matter are short:

capabilities:
  continuousScan: enable
  vulnerabilityScan: enable
  relevancy: enable
  runtimeObservability: enable

storage:
  # Remove scan results of images that no longer run every hour instead of every 6 hours,
  # so a fixed CVE disappears soon after the rollout.
  cleanupInterval: 1h

kubevuln:
  env:
    # Also scan containers that were already running when the node-agent started.
    - name: PARTIALRELEVANCY
      value: "true"

Starting from Kubescape

Looking at what Kubescape already gives you

Before writing anything ourselves, we wanted to understand what Kubescape stores and what it exposes. This is roughly how a scan flows through it:

Inside Kubescape: the node-agent records what each container opens, kubevuln matches the image SBOM with Grype and writes a manifest per image, a filtered one per workload, and a summary with counts

  1. When a container starts, the node-agent starts recording which files it opens. After a learning period (we use up to 24 hours, so daily jobs are seen too) it writes a ContainerProfile.
  2. An SBOM of the image is built with Syft. In current versions the node-agent does that itself, on the node.
  3. kubevuln matches the SBOM against the Grype database and writes a VulnerabilityManifest for the image: every CVE in every package.
  4. With the profile, kubevuln keeps only the packages whose files were opened and writes a second, filtered VulnerabilityManifest for that workload instance. Those are the relevant CVEs.
  5. Per workload container it writes a VulnerabilityManifestSummary: per severity, how many CVEs the image has and how many of them are relevant.
  6. A daily kubevuln-scheduler CronJob rescans everything against the newest Grype database, so a CVE published yesterday shows up today without a new image.

All of this lives in Kubescape’s own storage, an aggregated API server, so you can look at it with kubectl:

kubectl get vulnerabilitymanifests -n kubescape
kubectl get vulnerabilitymanifestsummaries -n kubescape
kubectl get vulnerabilitymanifest <name> -n kubescape -o yaml

(Our namespace is called pf-kubescape, so adjust that.)

The summary is what the operator’s built-in Prometheus exporter reads, and that is all it can publish: counts. The exporter turns them into gauges per namespace and per workload container:

kubescape_vulnerabilities_total_workload_critical{namespace="pf-monitoring", workload="alloy",
  workload_kind="daemonset", workload_container_name="alloy"} 2
kubescape_vulnerabilities_relevant_workload_critical{namespace="pf-monitoring", workload="alloy",
  workload_kind="daemonset", workload_container_name="alloy"} 2

The same for every other severity, plus a similar set for the configuration controls. On our lab cluster that was 4,736 series.

The dashboard you can build on that

Our first dashboard was built on exactly those metrics, and it did not take long. Stats for relevant and total criticals and highs, a table per workload container, and two trend lines (left out of the screenshot):

A dashboard on Kubescape’s built-in exporter: counts of relevant and all critical and high CVEs, and a table per workload container

The queries are as simple as they come:

# The scrape renames the exporter's own namespace label to exported_namespace.
sum by (exported_namespace, workload, workload_kind, workload_container_name) (
  kubescape_vulnerabilities_relevant_workload_critical{cluster="$cluster"}
)

And it works. You can see that alloy loads two critical CVEs and litellm one. You can put an alert on “relevant critical > 0” and you will hear about it.

Where counts stop being useful

Then the alert fires, and the first question is: which CVE? The dashboard cannot tell you. Neither can the alert. Every useful follow-up question is missing from the metrics:

  • Which CVE is it? There is no CVE ID anywhere, only a number.
  • In which package, and which version fixes it? Not there. So you cannot tell “bump the image” from “wait for upstream”.
  • Which other workloads load the same CVE? You cannot join on a CVE you do not have.
  • Is it being exploited? Kubescape’s results do not contain EPSS or KEV data at all.
  • Can anyone reach this workload? Kubescape does not look at routes or load balancers.
  • What changed since yesterday? A count going from 3 to 3 can hide one fixed CVE and one new one.

So the counts are fine for what they are: a cheap alert and a rough overview. They are useless the moment you want to do something, because then you end up scrolling through kubectl get -o yaml of a manifest by hand. That works for one curious engineer, but nobody does it every day.

Exporting the scan reports

What is in a scan report

The information is there though. It is in the VulnerabilityManifest, the object the summary is counted from. The payload is a Grype report, one entry per match. Trimmed a lot, the filtered manifest of a workload looks like this:

apiVersion: spdx.softwarecomposition.kubescape.io/v1beta1
kind: VulnerabilityManifest
metadata:
  name: replicaset-velero-64744bd8b6-velero-63a1-6543
  namespace: pf-kubescape
  labels:
    kubescape.io/context: filtered
    kubescape.io/workload-namespace: pf-velero
    kubescape.io/workload-kind: Deployment
    kubescape.io/workload-name: velero
    kubescape.io/workload-container-name: velero
  annotations:
    kubescape.io/image-id: docker.io/velero/velero@sha256:37396519f399…
    kubescape.io/image-tag: docker.io/velero/velero:v1.18.2
spec:
  metadata:
    withRelevancy: true
    tool:
      version: v0.121.0-matching-adaptive
      databaseVersion: fdc0c98e…
    report:
      createdAt: "2026-11-07T11:55:32Z"
  payload:
    matches:
      - vulnerability:
          id: CVE-2026-78663
          severity: Critical
          fix:
            versions: ["0.60.0"]
            state: fixed
          description: …
          urls: […]
          cvss: […]
        relatedVulnerabilities:
          - id: …
        artifact:
          name: golang.org/x/net
          version: v0.55.0
          locations: […]
          purl: …
          cpes: […]

There is one manifest per image (withRelevancy: false, every CVE) and one filtered manifest per workload instance (withRelevancy: true, loaded packages only). Between them they have everything the counts threw away. A few things we found out the hard way:

  • The storage API returns lists without spec unless you ask for resourceVersion=fullSpec. Your first list will look empty and you will think the scan is broken.
  • A manifest is big: descriptions, CVSS vectors and URLs for every match. The velero image alone had 222 matches, 102 of them the same CVE in the same stdlib version, found in several Go binaries.
  • Vulnerability IDs are not always CVEs. A Go module finding can be a GO-… or GHSA-… ID with the CVE in relatedVulnerabilities.
  • databaseVersion is a content hash, not a date. The scan time is in report.createdAt.

What we have to work with

Laying it all out, this is what is available and where it comes from:

Information Source In Kubescape’s exporter?
CVE ID, and its aliases (GHSA, GO) vulnerability.id, relatedVulnerabilities no
Severity vulnerability.severity only as a count
Package and installed version artifact.name, artifact.version no
Fixed version, and whether a fix exists vulnerability.fix no
Image, tag and digest the manifest’s annotations no
Namespace, workload, kind, container the filtered manifest’s labels yes, as labels on the counts
Loaded at runtime the filtered manifest (withRelevancy) only as a count
Scan time spec.metadata.report.createdAt no
Description, CVSS, URLs, file locations per match no
Exploited in the wild (KEV), probability (EPSS) not in Kubescape no
Reachable from outside the cluster not in Kubescape no

The last two rows are the ones that turn a long list into a short one. They are not in Kubescape, but they are not far away either:

  • CISA publishes its Known Exploited Vulnerabilities catalog as JSON, and FIRST publishes the EPSS scores (the probability a CVE gets exploited in the next 30 days) as a daily CSV.
  • Whether a workload is exposed is right there in the cluster: Gateway API routes, Ingresses and Services of type LoadBalancer, followed through their EndpointSlices to the pods. And whether that load balancer is open to the world or limited by loadBalancerSourceRanges.

So we export it ourselves

We had the data and the context, and Prometheus, Grafana and Alertmanager already watch all three clusters. We looked at Dependency-Track and at Kubescape’s Headlamp plugin. Dependency-Track is a second CVE engine with different numbers and no relevancy unless you glue it in yourself, plus one more stateful app to run. The Headlamp plugin is a UI per cluster that you have to host and secure, outside the tools we already use.

So the plan became: one small exporter per cluster that reads the manifests, adds the context, and serves it as Prometheus series. Everything after that is PromQL and dashboards, which we already know how to do.

How the exporter works

kubescape-findings-exporter is a single Go binary, about 1,500 lines without the tests. It does one thing in a loop:

Architecture: Kubescape writes VulnerabilityManifests, the exporter turns them into series for the central Prometheus

Every five minutes it lists all VulnerabilityManifests (ten at a time, they are big), lists the Gateway API routes, Ingresses, Services, EndpointSlices, Pods and ReplicaSets for the exposure, builds the complete set of series, and swaps it in at once. Only when every list succeeded:

func refresh(ctx context.Context, c *Collector, list func(context.Context) ([]Manifest, error),
	listCluster func(context.Context) (Cluster, error), listSummaries func(context.Context) ([]Summary, error),
	minSeverity string, timeout time.Duration) (Snapshot, error) {
	ctx, cancel := context.WithTimeout(ctx, timeout)
	defer cancel()
	ms, err := list(ctx)
	if err != nil {
		return Snapshot{}, err
	}
	cl, err := listCluster(ctx)
	if err != nil {
		return Snapshot{}, err
	}
	ss, err := listSummaries(ctx)
	if err != nil {
		return Snapshot{}, err
	}
	snap := Build(ms, minSeverity)
	snap.Exposures = BuildExposure(cl)
	snap.Posture = BuildPosture(ss)
	c.Set(snap, time.Now())
	return snap, nil
}

A scrape always gets the last complete snapshot, never half a list. If a list fails, the old snapshot stays and a last_success_timestamp metric stops moving, which is something we can alert on. Once a day it downloads the EPSS and KEV feeds, and only publishes them for the CVEs that exist on the cluster (the full EPSS file has about 400,000 CVEs).

The series model is where most of the thinking went:

# One set per image digest: grows with unique images, not with replicas.
kubescape_image_vulnerability{digest="sha256:aaa…", image="litellm", tag="1.77.3",
  cve="CVE-2026-1001", severity="critical", package="golang.org/x/net", version="0.38.0",
  fixed_version="0.45.0", fix_state="fixed"} 1

# A thin series per workload container, only for CVEs it loads. No severity: join it with the image series.
kubescape_workload_vulnerability_relevant{namespace="litellm", workload="litellm", container="litellm",
  digest="sha256:aaa…", cve="CVE-2026-1001", package="golang.org/x/net", version="0.38.0"} 1

# Context the scanner does not have.
kubescape_cve_kev{cve="CVE-2026-1001", ransomware="known"} 1
kubescape_cve_epss_score{cve="CVE-2026-1001"} 0.93
kubescape_workload_exposure_info{namespace="litellm", workload="litellm", via="HTTPRoute",
  gateway="pf-gateway/public", hostname="llm.apps.lab.example", access="public"} 1

The choices that paid off:

  • One set of series per image digest. Ten WordPress sites on the same image are one CVE list plus ten small “relevant” lists, not ten full lists.
  • The relevant series carries no severity or fix. It only says “this container loads this CVE in this package”. The rest comes from the image series. That keeps it tiny.
  • Read only what you use. The exporter decodes a handful of fields of each match into its own struct instead of pulling in Kubescape’s typed client. That keeps memory flat while listing manifests of a few MB each.
  • Exposure is computed from the cluster, for any gateway controller. Gateways and Ingresses are matched to their LoadBalancer Service by address, and the Service decides how open it is:
access := func(s Service) string {
	switch {
	case s.Spec.Type != "LoadBalancer":
		return "unknown"
	case len(s.Spec.LoadBalancerSourceRanges) > 0:
		return "restricted"
	}
	return "public"
}

One lesson cost us a broken alert: during an exporter restart, the old and the new pod serve the same series for a few minutes, differing only in pod and instance. A group_left join fails on those duplicates. Every query now first reduces to the series’ own labels and joins with and on. The chart also runs the exporter with the Recreate strategy for the same reason.

How many series is that?

This was the question we got most when we proposed it: “one series per CVE, won’t that blow up Prometheus?”

On lab, at the time we designed it:

Series
Kubescape’s built-in exporter (counts only) 4,736
kubescape_image_vulnerability (before deduplication by digest) at most 4,655
kubescape_workload_vulnerability_relevant about 1,950
Our CVE series in total about 6,600
The whole lab Prometheus about 200,000

So about 3% of that Prometheus, and about 1% of what each cluster sends to the central one. Barely more than the counts we replaced, but with every CVE, package, fixed version and workload in it. Once the dashboards and alerts ran on our exporter, we switched the built-in one off: nothing read its 4,736 series anymore.

Why it stays small:

  • Image series grow with unique images, not with replicas or workloads.
  • Relevant series grow with what is actually loaded, which is the small part.
  • Only critical, high and medium are exported. Low and negligible are not worth a series each.
  • EPSS and KEV only for CVEs that exist on the cluster.
  • The one real source of churn is the Grype database: a new fixed_version replaces a series. That is a few a day.

It did hurt in Grafana. On tool, joining every loaded CVE with its image series inside Grafana went over Grafana’s limit of 100,000 SQL input cells. The join now lives in a recording rule (kubescape:workload_vulnerability_relevant:joined), so the dashboard reads one small, pre-joined table.

If you want to check it on your own cluster:

count by (__name__) ({__name__=~"kubescape_.*", cluster="lab"})

From metrics to a to-do list

Alerts first, dashboard second

We decided on the alerts before drawing a single panel, because the dashboard should never disagree with Alertmanager. Alerting is per workload container, not per CVE (lab alone had 170 relevant critical CVEs), and only on loaded packages:

Alert Severity
Loaded CVE on the KEV list, workload reachable from outside critical
Loaded critical CVE, workload reachable from outside critical
Loaded CVE on the KEV list warning
Loaded critical CVE with a fix warning
Loaded CVE with an EPSS of 10% or more warning
Loaded critical CVE without a fix yet info

The rule for a fixable critical looks like this. kubescape:container_digest:running is a recording rule on kube-state-metrics with the digest each container runs right now, so an image update clears the alert within minutes instead of when Kubescape gets round to cleaning up:

- alert: VulnerabilityRelevantCriticalFixable
  expr: |-
    count by (cluster, namespace, workload, container) (
      max by (cluster, namespace, workload, container, digest, cve, package, version) (
        kubescape_workload_vulnerability_relevant{kind=~"Deployment|StatefulSet|DaemonSet"}
      )
      and on (cluster, namespace, container, digest) kubescape:container_digest:running
      and on (cluster, digest, cve, package, version)
      kubescape_image_vulnerability{severity="critical", fix_state="fixed"}
    ) > 0
  for: 1h
  keep_firing_for: 15m
  labels:
    severity: warning

The for: 1h covers a rollout, while the new image is still being scanned and its relevancy data is incomplete. keep_firing_for covers an exporter restart. Jobs are left out on purpose: they get a new name every run, so every run looked like a new workload with a new alert and then a resolved one.

The routing took as much tuning as the rules. Our first version was too loud: a red banner for a KEV CVE in a Crossplane provider that nothing outside the cluster can talk to, and for which upstream had no new image yet. Now only the exposed cases are critical. The warnings are a weekly nudge, one message per alert type listing every container, not a Slack message every few hours:

- receiver: slack-warning
  group_by: [alertname]
  group_interval: 168h
  repeat_interval: 168h
  matchers:
    - alertname =~ "VulnerabilityRelevantCriticalFixable|VulnerabilityRelevantKEV|VulnerabilityRelevantHighEPSS"

And an inhibit rule makes sure a container with an exposed critical gets that one alert, not also the warning:

- source_matchers:
    - alertname = "VulnerabilityRelevantCriticalExposed"
  target_matchers:
    - alertname =~ "VulnerabilityRelevantCriticalFixable|VulnerabilityRelevantCriticalUnfixed"
  equal: [cluster, namespace, workload, container]

Finally, a security dashboard that silently shows old data is worse than none. Four more alerts watch the pipeline itself: the exporter not listing, the EPSS or KEV download failing, the feed data itself getting old, and the daily Kubescape rescan not running.

The vulnerability rules in Prometheus, firing on the synthetic test data

The dashboard

The first version of the new dashboard showed all the data, all on one page, and answered nothing at a glance. We rebuilt it around one question per tab, with a verdict and a funnel on the first one.

The Overview tab: verdict, exposure status, the funnel from 9 CVEs to 2, what changed since yesterday and today’s to-do list

The Overview tab reads top to bottom:

  1. Verdict. Red, amber or green, driven by the firing alerts (it reads ALERTS), so it says exactly what Alertmanager says. Every number in it is a link to the matching workloads, and it says how many workloads got or lost an alert since yesterday.
  2. Funnel. 9 CVEs in running images, 7 loaded at runtime, 3 exploitable (KEV or EPSS of 10% or more), 2 exploitable and exposed. That last number is the one to act on.
  3. Changed since yesterday. New, resolved, now on KEV, fix now available.
  4. To do today. One row per workload container, with the reasons as chips: on KEV, EPSS score, public or restricted, fixable or not. Click the CVE to see where else it is loaded.

The Workloads tab is the direct answer to the question the old dashboard left open: for each container, which CVEs it loads, in which package, and which version fixes it.

The Workloads tab: loaded versus all CVEs per container, how it is reached, and every CVE of the selection with its fix

CVEs turns it around: one row per CVE, exploited first, with the fix as installed → fixed version, and where each one is loaded. That is the list a team works through when they bump a base image:

The CVEs tab: severity, KEV, EPSS, the package with its fixed version, exposure and where it is loaded

Changes compares the state now with yesterday, last week or four weeks ago, and says why each row changed: a new image, a CVE that just got on the KEV list, a fix that became available, a workload that became reachable. It also keeps “now loaded” apart from “new”: a restarted pod loads more at startup, and on lab that once made 54 CVEs look new without a new image.

The Changes tab: what changed since yesterday and why, with the rows that start or stop an alert marked

Exposure shows every workload that can be reached from outside the cluster, how (route, gateway, hostname, public or restricted), and what it loads behind that entry point:

The Exposure tab: exposed workloads by access, the risk behind each entry point, and every entry point

And because the alerts above exist, there is a small “data health” row that shows how old every piece of data is, so nobody trusts a green verdict built on a feed that stopped updating last week:

Data health: EPSS and KEV data age, last exporter list, last daily scan, feed downloads and images without a scan

Grafana has no “chip” or “banner” panel, and we did not want plugins. All the coloured badges, bars and the verdict are HTML, built by Grafana SQL expressions over hidden instant PromQL queries and rendered in markdown table cells:

SELECT cve AS CVE,
  CASE severity
    WHEN 'critical' THEN '<span style="background:#8F3BB8;color:#fff;border-radius:10px;padding:1px 9px">Critical</span>'
    WHEN 'high'     THEN '<span style="background:#E02F44;color:#fff;border-radius:10px;padding:1px 9px">High</span>'
  END AS Severity
FROM A WHERE __value__ > 0

Some things we learned there:

  • Grafana’s HTML sanitizer strips inline <svg>. Use <img src="data:image/svg+xml,…"> instead.
  • Query refIds are table names and SQL names are case-insensitive, so a CTE called a clashes with query A.
  • Not every MySQL function is allowed. LEAST works, GREATEST and CONCAT_WS do not.
  • A dashboard this size is not something you edit by hand. A Python script generates the JSON (Grafana’s v2 schema, with tabs), and a test script starts a local Prometheus and Grafana in Docker with synthetic data for four clusters, loads the real alert rules, and checks the output of every panel. The screenshots in this post come from that stack.

Wrapping up

Open source and a bit of vibe coding

The scanning is Kubescape, Grype and Syft. The context comes from two public feeds, from CISA and FIRST. Prometheus, Alertmanager and Grafana were already running. We wrote two things ourselves: a 1,500-line Go exporter and a Python script that generates a dashboard. Both were written with an AI coding assistant doing most of the typing, with us deciding what to build, reading every diff, and testing it against real manifests from lab. The exporter is open source: warpnet/kubescape-findings-exporter.

What that gets us:

  • every CVE in every running image, with the version that fixes it;
  • which of those are actually loaded, per container;
  • which are exploited in the wild or likely to be;
  • which workloads can be reached from outside, and how;
  • what changed since yesterday, and why;
  • alerts that agree with the dashboard, graded by all of the above.

That is most of what the vulnerability part of the commercial runtime security platforms sells, at least for “what do I fix first”. It is not all of it. There is no triage workflow with an audit trail, no ticket integration, nobody to call when it breaks, and we scan running workloads and our registry, not the nodes yet. But the gap is a lot smaller than I expected when we started, and not long ago the alternative was “4,736 counters and a shrug”.

Writing the glue used to be most of the work in a project like this. This time, most of the work was deciding which question we wanted answered. Once we wrote down “which CVEs can hurt us, and what do we fix today”, every design decision followed from it.

What’s next

A few things are still open, roughly in the order we will do them:

  1. The nodes. Kubescape can build an SBOM of each node’s filesystem, but in chart 1.41.0 the operator never asked kubevuln to scan it. That is fixed upstream; once the release with the fix is out, the same exporter and dashboard can cover the OS packages and kernel of every node. Expect noise there: the kernel is matched on its upstream version, and Ubuntu backports fixes without changing it.
  2. Harbor. Generating SBOMs on push, so images that do not run yet are covered too, and showing Harbor’s Trivy results next to Kubescape’s where they disagree.
  3. Runtime threat detection. The node-agent can also alert on suspicious behaviour, the Falco group in the list above. Wiring that into Alertmanager is the next step. Something like Tetragon only if we want to block, not just alert.
  4. A triage workflow, if suppressions in Git (Kubescape’s VulnerabilityExceptionPolicy) turn out not to be enough. Dependency-Track or DefectDojo on top of this data, not instead of it.
  5. Upstream. Ideally the per-CVE metrics end up in Kubescape’s own exporter, so nobody else has to write this.
  6. Fixing, not just finding. Tools like Copacetic (CNCF sandbox) patch OS packages in an image without rebuilding it. Combined with the fixable list from the dashboard, that is a tempting next experiment.

The configuration posture side of Kubescape (CIS and friends) already went through the same exporter in the meantime. That is a story for another post.

The screenshots use synthetic test data from our local test stack, not our production clusters. The series counts are from our lab cluster.

  1. Why counting CVEs is not enough
  2. Starting from Kubescape
  3. Exporting the scan reports
  4. From metrics to a to-do list
  5. Wrapping up

Written by Haije Ploeg, platform engineer. More in all writing and RSS.