Set up#
You need a ClickHouse server, the OpenTelemetry Collector Contrib
distribution (otelcol-contrib) and shirudo-quote-check from
shirudo’s operator package on the ClickHouse host. Run the commands
from tools/backend/ of a shirudo checkout.
Install the quote checker as the
tpm_quote_checkfunction. Copy the declaration beside the server’sconfig.xmland the program into the server’suser_scriptsdirectory, then have the server read it:# install -m 0644 clickhouse/tpm_quote_check_function.xml /etc/clickhouse-server/ # install -m 0755 "$(command -v shirudo-quote-check)" /var/lib/clickhouse/user_scripts/ $ clickhouse-client --query 'SYSTEM RELOAD FUNCTIONS'
The server starts up to four checker processes and keeps them. Each reads rows of
attest,sig,akand the body’s SHA-256 separated by tabs, and answers every row with one line of JSON. The checker keeps no state and no list of keys: a pass says that the body is what this key signed, not that the key lives in a genuine TPM.Load the schema. The function has to exist first, because
shirudo.checked_mvnames it:$ for file in sql/*.sql; do clickhouse-client <"$file"; done $ sql/apply-retention.sh
Loading it again changes nothing.
sql/apply-retention.shgivesshirudo.keepaliveandshirudo.boot_firstthe retention thatshirudo.settingsnames (Maintain the backend). It runsclickhouse-client, or the command given as its arguments:$ sql/apply-retention.sh clickhouse-client --host ch.example.com --secure
Run the collector with
otelcol.yaml. It reads its TLS certificate and key from/certs/server.pemand/certs/server.keyand writes totcp://clickhouse:9000asdefault, unlessOTLP_TLS_CERT,OTLP_TLS_KEY,CLICKHOUSE_ENDPOINT,CLICKHOUSE_USERandCLICKHOUSE_PASSWORDsay otherwise. The collector’s user needsINSERTonotel.otel_logsand nothing else. Targets require TLS 1.3 with a hybrid ML-KEM key exchange, which a collector built with Go 1.24 or later offers.Point the targets at the collector, as Monitor and export telemetry describes.