Skip to main content

Module audit

Module audit 

Source
Available on crate feature audit only.
Expand description

Tamper-evident audit records (ADR 0015).

An AuditRecord says who did what to which task, when, and in which trace, with the content it concerned recorded by SHA-256 digest. Records form one hash chain per tenant: each carries the hash of the one before, so an edit, insertion, deletion or reordering anywhere is found by verify_chain. Checkpoints, signed with ES256 or Ed25519, vouch for how far the chain had reached, so cutting records off the end is found too, back to the last checkpoint.

This module is pure data and verification: it writes nothing anywhere. The server crate’s audit module records calls and task events into it, and the a2a command line verifies an exported chain with it.

What it does not do: the time in a record is the writer’s clock, not a trusted timestamp, and a writer holding the signing key can rewrite the whole chain and re-sign it. Tamper evidence here is against anyone who can edit the store but does not hold the key — keep the key elsewhere, and export checkpoints off the machine.

Modules§

kind
The record kinds this crate writes.

Structs§

Actor
Who a call was made by, as authentication established it.
AuditRecord
One entry in an audit chain.
ChainFailure
Where and why a chain failed to verify.
ChainReport
What verify_chain found.
Checkpoint
A signed statement of how far a chain had reached.
CheckpointSigner
A private key that signs checkpoints.
Outcome
How a call ended.
TraceRef
The W3C trace a record belongs to, for joining it to the spans of the same call across agents.
TrustedKey
A public key a verifier trusts to have signed checkpoints.

Enums§

SigningAlg
The signature algorithms a checkpoint can be signed with.

Constants§

CHECKPOINT_SCHEMA
The schema identifier every checkpoint of this version carries.
MAX_SEQ
The largest sequence number a record can carry.
SCHEMA
The schema identifier every record of this version carries.

Functions§

digest_bytes
"sha256:<hex>" over raw bytes.
digest_of
"sha256:<hex>" over the canonical JSON of any serializable value.
digest_value
"sha256:<hex>" over the RFC 8785 canonical form of value.
verify_chain
Verifies records, which must be one chain in seq order, against the checkpoints written for it, trusting signatures by keys.
verify_checkpoint
Checks a checkpoint’s signature against the keys a verifier trusts.