Backend#

Explanation · Operators, SecOps

The pages of Integrations describe export targets shirudo can use and alert on. This section describes a reference backend: it checks every keepalive’s TPM quote and compares what each target reports with the upatch tree it follows. It lives in tools/backend/: an OpenTelemetry Collector configuration, a ClickHouse schema, the jobs that load trees and SBOMs, and their tests. It is also what the end-to-end tests of shirudo itself run against, at the scale of many nodes and many upatches, which validates the event structure and the workflows with a working backend.

A target only sends its keepalive to the collector it is configured with, and nothing on the target depends on the backend. The backend does make it possible to test many nodes and to validate resource requirements. Start from it and adapt retention, access control, sizing and features for your deployment.

What it does#

  • An OpenTelemetry Collector configuration that writes every keepalive to ClickHouse, where a materialized view checks its quote with shirudo-quote-check, installed as the ClickHouse function tpm_quote_check, and keeps the record or the reason it was refused. A node is known by the name of its attestation key, never by the host name it claims, and its records are ordered by the quote’s clock.

  • A tree ingest job that loads every publication of a upatch tree through shirudo bpm tree show, which verifies it as a target does, and the fixes its operations carry.

  • A table, node_status, refreshed every minute, that says for every node whether it is healthy, unhealthy or stale, with one line per check: the record is fresh, the target reports no problem, its mask and roots match the tree, it is at the head of the tree or still within the time a rollout may take, the upatches it has loaded are from the published tree, and its outcomes match the results expected of the node.

  • A table, node_vulns, refreshed every five minutes, that says which advisories affect each node’s image and kernel and whether a published upatch shields it, which matches vulnerabilities to nodes from a standard SBOM.

shirudo-quote-check and shirudo bpm tree show come with the operator package, shirudo-quote-check and shirudo bpm describe them. A pass of the quote check says that the body is what one key signed, not that the key lives in a genuine TPM, so every node reads untrusted until you enroll its key (Maintain the backend) and insert enrolled for its ak_name into shirudo.nodes. Neither says that the body is true: root on a target can have its TPM quote a body of its own, so healthy is the target’s own account until shirudo attest verify confirms it (R17 of Threat model).

Files#

Path

Purpose

tools/backend/otelcol.yaml

Collector configuration: OTLP over HTTPS in, otel.otel_logs out.

tools/backend/clickhouse/tpm_quote_check_function.xml

Declares the tpm_quote_check function over the shirudo-quote-check program.

tools/backend/sql/

The schema, loaded in the order of the file names, and apply-retention.sh, which sets how long shirudo.keepalive keeps a record and shirudo.boot_first a boot.

tools/backend/jobs/tree-ingest

Loads every segment of a upatch tree into the reference tables.

tools/backend/jobs/labels-put

Loads the labels the operator gives the nodes, out of band (Label the nodes).

tools/put-shirudo-build

Allows builds of shirudo, by version_id or binary, in shirudo.expected_builds (Maintain the backend).

tools/backend/jobs/enroll-put

Enrolls the attestation keys a builder created in TPMs, from its records (Enroll keys from a builder).

tools/backend/jobs/shields-put

Loads the shields that tools/put-shields pushed, as available to append to a tree (List the shields available to append).

tools/backend/jobs/sbom-put

Stores the CycloneDX SBOM of an image in the SBOM store, for an image pipeline to call (Store an image’s SBOM).

tools/backend/jobs/sbom-scan

Scans the SBOM of every image in the SBOM store and loads the outcome into sbom_images and sbom_vulns.

tools/backend/jobs/job.sh, tools/backend/jobs/common.py

What the jobs share and read from their own directory: a job is installed with both and with its *-rows.py.

tools/backend/test/

The SQL tests and their runner, test/run.sh (Run the backend tests).

tools/xtop/

A terminal view of the nodes, over node_status, latest and node_vulns, of the upatches of the trees and their rollout, and of the SBOM findings and images (Watch nodes, shields and SBOMs with xtop).