Eventlog events#
The eventlog records every extension of the measurement register, one JSON object per line. A replay of this boot’s records reproduces the register value. Measurement register and attestation explains the register. This page gives the files, the record format, the event kinds and their digests, the replay rule and the limits.
Files#
Path |
Contents |
|---|---|
|
The eventlog. Mode |
|
The |
|
The register lock, an |
SHIRUDO_EVENTLOG_PATH and SHIRUDO_EVENTLOG_PENDING_PATH override
the two paths for host tests. A target running from a runtime image
refuses both, see Environment variables.
The upatch tree keeps its own projection log in
/var/lib/shirudo/bpm/upatch-tree/tree-eventlog, described in
upatch tree. Config image activations extend the config PCR
instead of the register and keep their records under
/var/lib/shirudo/config-update, see Config images and dm-verity.
Neither is part of the eventlog.
Record format#
One compact JSON object per line, terminated by
\n. A record is not in the log until its\nis: a last line without one is an append that did not finish, killed or cut short by a crash.A command appends a record only after the register extend succeeded, writes it and its
\nin onewrite, then callsfsync. An append that fails part-way is truncated back to the previous size, and the next append first drops a last line that did not finish, with a warning in the journal.Digests are SHA-256, written as 64 lowercase hex digits.
Every record carries these fields:
Field |
Type |
Value |
|---|---|---|
|
integer |
|
|
string |
Time of the append, ISO 8601 UTC, for example
|
|
string |
The register’s NV index, |
|
string |
|
|
string |
The event, 64 hex digits: the value extended into the register. |
|
string |
|
|
string |
|
Event kinds#
|
Written by |
Additional fields |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
As |
|
|
As |
|
|
|
|
|
|
Fields of an init record#
Field |
Type |
Value |
|---|---|---|
|
integer |
The TPM’s reset count when the register was bound. |
|
string |
Digest of the enrolled certificate set: the SHA-256 of the certificate DER when one certificate is enrolled, else the SHA-256 of the concatenated DER digests sorted bytewise. |
|
array of string |
SHA-256 of each enrolled certificate’s DER. |
|
string |
SHA-256 of the restored set listing (see Event digests). |
|
string |
The upatch tree’s |
|
array of object |
The upatches boot restore applied or found loaded, each with
|
|
integer |
|
|
string |
PCR 9 before the binding. |
|
integer |
|
|
string |
PCR 11 at the binding. |
|
string |
|
|
string |
The register’s TPM name after its first write, 68 hex digits
( |
|
string |
The NV writer key’s RSA modulus, 384 bytes big-endian, 768 hex digits. The exponent is 65537 and not stored. |
|
string |
|
|
string |
SHA-256 of the |
|
string |
The register value after the event. |
Event digests#
Each digest is a SHA-256 over a tag, its terminating NUL byte and the
event’s fields. Hex fields enter the hash as their 32 decoded bytes.
attest verify recomputes every non-init digest from the
record’s own fields and fails a record whose digest does not derive
from them. Its report names a record by what the digest covers: the
upatch name, the tree seq and operation_digest, or the
certificate’s cert_sha256. A tree operation’s op and id and
a key’s fingerprint are not shown, as verify cannot tie them to the
digest. Evidence with a record type other than lowercase letters and
_, or a upatch record without a valid upatch name, is no evidence
document.
|
|
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nameis the upatch name’s bytes without a terminating NUL, at most 256 bytes.seqis the tree sequence number as an 8-byte big-endian integer.set_digestis the SHA-256 of one line<payload_sha256> <name>\nper member ofset, prefixed withjava `` for a member whose ``typeisjava, sorted by name, concatenated. An empty set gives the SHA-256 of the empty string,e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.The register starts at 32 zero bytes after every TPM reset. Each event sets it to
SHA256(register || digest), the TPM’s NV extend.
Replay#
shirudo status, shirudo attest and the measuring commands select
this boot’s records the same way:
They read
/var/lib/shirudo/eventlogfollowed by/run/shirudo/eventlog.pending.They parse every line. One line that is not valid JSON fails the replay, whatever boot it belongs to, and so does a NUL anywhere in either file, which would end the walk early. A last line without
\nis skipped, as it is no record yet. The register then runs ahead of the log, as after an append that failed.They skip lines without a
boot_idor with another boot’sboot_id.They start at this boot’s first
initrecord. Everyinitrecord restarts the fold at 32 zero bytes, so the replay covers the lastinitrecord and the records after it.A boot without an
initrecord has no replay.
The upatches this boot measured are folded from the records the register
vouches for, which the undo pass of upatch load and upatch
unload, upatch reconcile and the UpatchesMeasured condition of
status read. A boot ID read by path is root’s to replace in a mount
namespace of its own, so they select the boot by the TPM instead:
They start at the last
initrecord whosenv_nameis the name of the live index and whosetpm_reset_countis the TPM’s reset count, both read over the sessioninitpinned.They derive each record’s digest from its fields, as the extend that wrote it computed it (see Event digests), and refuse a record whose
digestdiffers and a type no writer uses.They fold the records from zero and refuse unless the result is the value the TPM reports for the register.
A refusal is tampered for a load or an unload and an ALERT of
UpatchesMeasured in status. An init record starts the set
over with its set, and an upatch_load or upatch_unload
record adds or removes its upatch.
Only an init record’s set counts. Lean 4 proves the fold holds a
upatch exactly when the last record that bears on it, an init record
or a load or unload of it, leaves it loaded: its load, or an init
record whose set lists it, with that payload.
status compares the replay with the live register (condition
ChainIntact, field tpm.chain_matches_eventlog in
status JSON). It also reports a mismatch when the register’s
name differs from the recorded nv_name, when the recorded PCR values
and writer key do not give that name, and when two init records
name the same TPM reset count. shirudo attest puts the selected
records, verbatim, in the evidence’s eventlog array, see
Attest targets.
Pending record#
shirudo init run from the initrd writes its init record to
/run/shirudo/eventlog.pending. /run survives the switch to the
root file system. The init run of shirudo.service on the root
file system adopts it: it appends each pending line that this boot’s
part of the eventlog does not already hold, then removes the pending
file. Any other append adopts a pending record first. Every reader
takes the pending record only from a /run/shirudo that carries the
seal label, and only when the file carries it too: a /run of root’s
making, in a mount namespace of its own, cannot carry it.
Size limits#
Limit |
Behavior |
|---|---|
|
Signed config setting, default |
Reader cap, 8 MiB |
Readers load at most 8388608 bytes: the eventlog alone, and the
eventlog and the pending record together. Above that the replay
fails. |
The eventlog grows across boots and shirudo never shortens it. Keep
eventlog.max_bytes at or below 8388608 so that a refusal with
eventlog_full comes before the reader cap.
Example#
shirudo status --include-eventlog on a test target after one boot,
one load and one unload prints the eventlog as a table (excerpt):
Eventlog:
TIME TYPE DIGEST DETAIL
2026-10-29T16:17:38Z init cb206abf8e51 set_digest=e3b0c44298fc..
2026-10-29T16:21:19Z upatch_load d979b373d4e5 shirudo-test-basic payload=8aee7072a1a1..
2026-10-29T16:21:20Z upatch_unload 26dae981e9bb shirudo-test-basic payload=8aee7072a1a1..
The upatch_load record of that eventlog, one line:
{"schema":1,"ts":"2026-10-29T16:21:19Z","nv_index":"0x01818E00","alg":"sha256","digest":"d979b373d4e5c59775c06c3bee5fd868d9d033db5403b290b61b512d4a293597","type":"upatch_load","boot_id":"743acb26-a7ee-405d-b45a-600484470644","upatch":{"name":"shirudo-test-basic","payload_sha256":"8aee7072a1a15e4dddc93ad6b253a0e2e70ad6cdf767442aa8a1c1997bc3069f"}}
Its init record, indented here, with the 768 hex digits of
nv_writer_public shortened:
{
"schema": 1,
"ts": "2026-10-29T16:17:38Z",
"nv_index": "0x01818E00",
"alg": "sha256",
"digest": "cb206abf8e514bc714fc69f372d464d2c7512f1489431aed2319551c5ed34b9a",
"type": "init",
"boot_id": "743acb26-a7ee-405d-b45a-600484470644",
"tpm_reset_count": 1,
"cert_sha256": "51a99fe89f5069a4d67131da3e1556dedbac7b2a1ec6702c51ca170c45d01d65",
"certs": [
"3702e8ffe817ade6151eea338194649cc3a5be1e0b940e462a1a75e52f7095d0",
"d95db97ff4658b96b8b538afef41a25ca9f7a2c4d0abffdb26cbac7b0ba294b9"
],
"set_digest": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"tree_root": "0000000000000000000000000000000000000000000000000000000000000000",
"set": [],
"pcr": 9,
"pcr_before": "0000000000000000000000000000000000000000000000000000000000000000",
"phase_pcr": 11,
"phase_before": "0000000000000000000000000000000000000000000000000000000000000000",
"bound_in": "initrd",
"nv_name": "000be3a552e2219550d2597ab96f3fffdeec0d01ce27cde858e0858ab0cdaba6c045",
"nv_writer_public": "b4d7434fadbc7cb1a0d6...e07197",
"anchor": "nvpcr-init:shirudo:0x1818e00:000be3a552e2219550d2597ab96f3fffdeec0d01ce27cde858e0858ab0cdaba6c045",
"anchor_digest": "6912e5d20117d2eb4d2e55429bf666b1bb24ea2cd3882468411b1192f3940d50",
"chain": "d1bdb80f7c0cfc1560f0a5a0b974d282bfd05fc95852b7649d59a054b450aa51"
}
The test VM boots without a measured UKI, so PCR 9 and PCR 11 were zero
when init bound the register. Folding the three digests from 32
zero bytes gives
e57e1428ab398e758b63f8eda52bac87b5d85c1368c2d8d786ed446448e46239,
the register value status showed after the unload.