Exposure#
Every five minutes: which nodes run a vulnerable package or kernel, and whether a upatch from their tree shields them. Packages come from the SBOM of the booted image, the kernel from kernel_release, the shield from the mask and node_ops.
Schema: tools/backend/sql/50-vulns.sql
Views, functions and jobs#
kver(release)SQL function (global).
Leading numbers of a kernel release: ‘7.4.2-shirudo’ → [7, 4, 2]. Arrays compare element-wise, so ranges work. A release with no leading number is [].
shirudo.node_vulns_mvrefreshable MV, every 5 minutes.
Joins node_status, latest, sbom_images, sbom_vulns, kernel_vulns, tree_ops, upatch_fixes and node_ops into node_vulns. Work is done per image, per kernel release and per tree path, then joined to nodes.
jobs/sbom-scanexternal job.
Scans every image in the SBOM store with Trivy and loads sbom_images and sbom_vulns.
shirudo.sbom_images#
One row per image in the SBOM store, with the outcome of its newest scan.
Only an image with state ok has findings in sbom_vulns.
A node’s SBOM is the one with the node’s own image_root if present, else the newest build of that id and version that has one.
- Engine:
ReplacingMergeTree(scanned_at)- Order by:
(image_id, image_version, image_root)- Defined in:
tools/backend/sql/50-vulns.sql- Written by:
tools/backend/jobs/sbom-scan(file://ors3://store, Trivy as matcher)- Fires on insert:
nothing
- Queried by:
node_vulns_mvintonode_vulns- Row size:
~300 B (estimate).
- Scale:
Images × versions × builds in the SBOM store.
- Reference fleet:
negligible
Columns (9)
Column |
Type |
Meaning |
|---|---|---|
|
|
Image name, e.g. fleet-os. |
|
|
e.g. 2026.11.1. |
|
|
Verity root. Empty for an image built without verity. |
|
|
From image.json; cyclonedx-json when it names none.
|
|
|
Hash of the SBOM file. Empty unless state is ok. Joins to sbom_vulns. |
|
|
Outcome of reading the SBOM. |
|
|
Image build time. Breaks ties between builds. |
|
|
Trivy advisory database version used. |
|
|
When this scan ran. |
shirudo.sbom_vulns#
Findings of every scan of an SBOM. An image’s current findings are the rows whose scanned_at equals its newest scan in sbom_images.
Kernel packages (linux-image-*, kernel, kernel-core) are ignored here: the node may run a different kernel than the image ships, so kernel findings come from kernel_vulns only.
- Engine:
MergeTree- Order by:
(sbom_sha256, vuln_id, package)- TTL:
scanned_at + INTERVAL 7 DAY- Defined in:
tools/backend/sql/50-vulns.sql- Written by:
- Fires on insert:
nothing
- Queried by:
node_vulns_mvintonode_vulns- Row size:
~80 B (estimate: sorted by SBOM, repeated strings compress).
- Scale:
Distinct SBOMs × findings × scans in the last 7 days.
- Reference fleet:
50 × 500 × 7 daily scans: 175k rows ≈ 15 MB
Columns (7)
Column |
Type |
Meaning |
|---|---|---|
|
|
Which SBOM. |
|
|
Advisory id, e.g. a CVE. |
|
|
Affected package. |
|
|
Installed version. |
|
|
First fixed version; empty when none exists. |
|
|
As Trivy reports it. |
|
|
Which scan produced the row. |
shirudo.kernel_vulns#
Kernel advisories, one row per affected range of releases. Matched against each distinct kernel_release with kver().
- Engine:
ReplacingMergeTree- Order by:
(vuln_id, introduced)- Defined in:
tools/backend/sql/50-vulns.sql- Written by:
the operator
- Fires on insert:
nothing
- Queried by:
node_vulns_mvintonode_vulns- Row size:
~60 B (estimate).
- Scale:
Affected release ranges of kernel advisories.
- Reference fleet:
thousands of rows, negligible
Columns (4)
Column |
Type |
Meaning |
|---|---|---|
|
|
Advisory id. |
|
|
First affected release, inclusive, e.g. [7, 0]. |
|
|
First fixed release, exclusive. Empty means no end. |
|
|
As the advisory gives it. |
shirudo.node_vulns#
One row per node and finding, plus one row with an empty vuln_id for a node with none, so a clean node differs from a missing one. This is what a UI reads for exposure.
A row says where the node is, not where the tree is.
A stale scan keeps its findings and sets sbom_stale. It never makes a node read clean: a node without findings then reads unknown.
With several upatches linked to one advisory, the best exposure wins, in enum order.
- Engine:
MergeTree- Order by:
(node_id, ak_name, vuln_id, package)- Defined in:
tools/backend/sql/50-vulns.sql- Written by:
node_vulns_mv(refresh every 5 minutes, replaces the table)- Fires on insert:
nothing
- Queried by:
the UI
- Row size:
~60 B (estimate: sorted by node; repeated strings compress well).
- Scale:
Nodes × (findings on their image and kernel + 1). The whole table is rewritten every 5 minutes.
- Reference fleet:
10,000 × 500: 5M rows ≈ 300 MB, rewritten every 5 minutes
Columns (24)
Column |
Type |
Meaning |
|---|---|---|
|
|
Node, as in node_status. |
|
|
Node, as in node_status. |
|
|
Node, as in node_status. |
|
|
Copied from node_status. |
|
|
Copied from node_status. |
|
|
From the node’s newest record. |
|
|
From the node’s newest record. |
|
|
How far the SBOM can be trusted to describe the node. verified: image_root matches the SBOM’s. |
|
|
Newest scan is older than sbom_stale_seconds. |
|
|
Where the finding came from. |
|
|
Empty for the ‘no findings’ row. |
|
|
From sbom_vulns, or linux / kernel_release / fixed release for kernel findings. |
|
|
From sbom_vulns, or linux / kernel_release / fixed release for kernel findings. |
|
|
From sbom_vulns, or linux / kernel_release / fixed release for kernel findings. |
|
|
From sbom_vulns, or linux / kernel_release / fixed release for kernel findings. |
|
|
Best first: shielded, shield_pending, shield_module_absent, shield_excludes_node, shield_withdrawn, exposed_no_shield, none, unknown. |
|
|
Linked upatch the outcome is read from. |
|
|
Newest operation of that upatch the node has applied; 0 and empty if none. |
|
|
Newest operation of that upatch the node has applied; 0 and empty if none. |
|
|
Newest operation of that upatch in the tree. next_seq > applied_seq means something is coming. |
|
|
Newest operation of that upatch in the tree. next_seq > applied_seq means something is coming. |
|
|
The newest operation is an add linked to this advisory. |
|
|
Where the advisory link comes from. |
|
|
When the row was computed. |