chainaudit

command
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2026 License: GPL-3.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command chainaudit recomputes every audit_log_chain row against live data and classifies why it does or does not verify.

It exists because "the chain reports 80 breaks" is not actionable on its own. Rebaselining a tamper-evident chain re-signs whatever is there, so it erases evidence as readily as it clears noise. Before doing that we have to show that every break is explained by a known defect and none is an unexplained mismatch.

The known defect: ComputeAuditChainHash used to reduce the timestamp with Truncate(time.Microsecond) while PostgreSQL ROUNDS timestamptz to microseconds. Any timestamp whose nanosecond remainder was >= 500ns therefore hashed one value at write time and a different one at verify time. Fixed in api#361; this tool measures the wreckage that fix left behind.

Classification per row:

verifies        - recomputes to the stored hash with the current (Round) code
legacy truncate - matches at stored_ts-1us => the #79..#361 truncate/round bug
pre-#79         - matches once the lost sub-microsecond remainder is brute
                  forced back => the original nanosecond-precision hash
UNEXPLAINED     - matches under none of the above. This is the one that matters:
                  a row here is either a defect nobody has characterized yet or
                  an actual tamper, and rebaselining would erase the difference.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL