Persist audit actions to a tamper-evident hash-chained store - #1028
Open
pavsoss wants to merge 1 commit into
Open
Persist audit actions to a tamper-evident hash-chained store#1028pavsoss wants to merge 1 commit into
pavsoss wants to merge 1 commit into
Conversation
|
@pavsoss is attempting to deploy a commit to the Aditya Sharma's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part 1 of 2 for #1023. Audited actions were only written as free-text log
lines — editable after the fact and impossible to query. This adds a durable
audit store backed by SQLite (no new dependencies) that links every record
into a SHA-256 hash chain: each record commits to the hash of the one before
it, so editing or deleting any record invalidates every hash that follows. A
verify_chainroutine recomputes the chain and reports whether the trail isintact.
The existing
audit_logdecorator now persists a structured record — actor,action, resource, correlation id, resulting status and a UTC timestamp — in
addition to the log line it already writes. Persistence is fail-soft: a store
failure is logged and swallowed so it can never turn a successful request into
an error. The database location is configurable via
AUDIT_DB_PATH.Parts
Targets the default branch.
stacked on top of this.
Test plan
Regression coverage for appending records and confirming the chain verifies,
plus proof that a field edit, a status edit and an interior row deletion are
each detected as tampering.
Refs #1023