What it does
Structured audit logging with tamper-evident chaining. Every write produces a cryptographically linked record (hash chain). Compliance-grade output (who, what, when, where, result). Pluggable backends. Foundation for HIPAA, SOC 2, and PCI-DSS compliance.
Quick start
[]
= { = "0.5", = ["sha2"] }
use ;
// Plug in any monotonic time source.
;
let mut chain = new;
chain.append.expect;
// Later, prove the chain is untampered.
let = chain.into_parts;
let mut verifier = new;
for r in sink.records
Persisting to a file
use ;
# ;
# let clock = C;
let sink = open_or_create.expect;
let mut chain = new;
// ... chain.append(...) ...
// Replay and verify the on-disk log.
let mut verifier = new;
for record in open.expect
FileSink writes a versioned 16-byte header on a fresh file, then
length-prefixed records using the stable [codec] encoding. Reopening
the same path appends after validating the header.
Features
| Feature | Default | What it adds |
|---|---|---|
std |
yes | FileSink, FileReader, std::error::Error impls. Implies alloc. |
alloc |
yes (via std) |
OwnedRecord, MemorySink, codec module |
sha2 |
no | Sha256Hasher (reference SHA-256 implementation) |
For no_std use default-features = false and supply your own hasher,
sink, and clock.
Standards
- REPS governs every decision. See REPS.md.
- MSRV: Rust 1.85.
- Edition: 2024.
- Cross-platform: Linux, macOS, Windows.
License
Dual-licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option.