Exposure#

Reference · Operators

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_mv

refreshable 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-scan

external job.

Scans every image in the SBOM store with Trivy and loads sbom_images and sbom_vulns.

shirudo.sbom_images#

Reference data

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:// or s3:// store, Trivy as matcher)

Fires on insert:

nothing

Queried by:

node_vulns_mv into node_vulns

Row size:

~300 B (estimate).

Scale:

Images × versions × builds in the SBOM store.

Reference fleet:

negligible

Columns (9)

Column

Type

Meaning

image_id

String

Image name, e.g. fleet-os.

image_version

String

e.g. 2026.11.1.

image_root

String

Verity root. Empty for an image built without verity.

sbom_format

LowCardinality(String)

From image.json; cyclonedx-json when it names none.

DEFAULT 'cyclonedx-json'

sbom_sha256

String

Hash of the SBOM file. Empty unless state is ok. Joins to sbom_vulns.

state

Enum8('ok' = 1, 'missing' = 2, 'hash_mismatch' = 3, 'parse_error' = 4, 'unsupported_format' = 5)

Outcome of reading the SBOM.

built_at

DateTime

Image build time. Breaks ties between builds.

db_version

String

Trivy advisory database version used.

scanned_at

DateTime

When this scan ran.

shirudo.sbom_vulns#

Reference data

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:

tools/backend/jobs/sbom-scan

Fires on insert:

nothing

Queried by:

node_vulns_mv into node_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

sbom_sha256

String

Which SBOM.

vuln_id

String

Advisory id, e.g. a CVE.

package

String

Affected package.

installed

String

Installed version.

fixed

String

First fixed version; empty when none exists.

severity

LowCardinality(String)

As Trivy reports it.

scanned_at

DateTime

Which scan produced the row.

shirudo.kernel_vulns#

Reference data

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_mv into node_vulns

Row size:

~60 B (estimate).

Scale:

Affected release ranges of kernel advisories.

Reference fleet:

thousands of rows, negligible

Columns (4)

Column

Type

Meaning

vuln_id

String

Advisory id.

introduced

Array(UInt32)

First affected release, inclusive, e.g. [7, 0].

fixed

Array(UInt32)

First fixed release, exclusive. Empty means no end.

severity

LowCardinality(String)

As the advisory gives it.

shirudo.node_vulns#

Derived by a view, read by the UI

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_id

String

Node, as in node_status.

ak_name

String

Node, as in node_status.

host_name

String

Node, as in node_status.

status

Enum8('healthy' = 1, 'unhealthy' = 2, 'stale' = 3)

Copied from node_status.

trust

Enum8('untrusted' = 0, 'enrolled' = 1)

Copied from node_status.

image_id

String

From the node’s newest record.

image_version

String

From the node’s newest record.

binding

Enum8('verified' = 1, 'declared' = 2, 'root_mismatch' = 3, 'no_sbom' = 4, 'no_image' = 5)

How far the SBOM can be trusted to describe the node. verified: image_root matches the SBOM’s.

sbom_stale

Bool

Newest scan is older than sbom_stale_seconds.

source

Enum8('sbom' = 1, 'kernel' = 2, 'none' = 3)

Where the finding came from.

vuln_id

String

Empty for the ‘no findings’ row.

severity

LowCardinality(String)

From sbom_vulns, or linux / kernel_release / fixed release for kernel findings.

package

String

From sbom_vulns, or linux / kernel_release / fixed release for kernel findings.

installed

String

From sbom_vulns, or linux / kernel_release / fixed release for kernel findings.

fixed

String

From sbom_vulns, or linux / kernel_release / fixed release for kernel findings.

exposure

Enum8('shielded' = 1, 'shield_pending' = 2, 'shield_module_absent' = 3, 'shield_excludes_node' = 4, 'shield_withdrawn' = 5, 'exposed_no_shield' = 6, 'none' = 7, 'unknown' = 8)

Best first: shielded, shield_pending, shield_module_absent, shield_excludes_node, shield_withdrawn, exposed_no_shield, none, unknown.

upatch_id

String

Linked upatch the outcome is read from.

applied_seq

UInt64

Newest operation of that upatch the node has applied; 0 and empty if none.

applied_op

Enum8('' = 0, 'add' = 1, 'delete' = 2)

Newest operation of that upatch the node has applied; 0 and empty if none.

next_seq

UInt64

Newest operation of that upatch in the tree. next_seq > applied_seq means something is coming.

next_op

Enum8('' = 0, 'add' = 1, 'delete' = 2)

Newest operation of that upatch in the tree. next_seq > applied_seq means something is coming.

next_shields

Bool

The newest operation is an add linked to this advisory.

shield_link

Enum8('none' = 0, 'fixes' = 1, 'manual' = 2)

Where the advisory link comes from.

updated_at

DateTime

When the row was computed.