audit
diapason.security.audit
¶
Audit logger — persist security events to SQLite with Merkle hash chain.
AuditLogger
¶
Append-only SQLite audit log for security events.
Parameters¶
db_path:
Path to the SQLite database file.
bus:
Optional event bus — if provided, subscribes to security events
(SECURITY_SCAN, SECURITY_ALERT, SECURITY_BLOCK).
close()
¶
Close the SQLite connection.
count()
¶
Return the total number of logged security events.
log(event)
¶
Insert a security event into the audit log with Merkle hash chain.
query(*, event_type=None, since=None, limit=100)
¶
Query logged security events with optional filters.
tail_hash()
¶
Return the hash of the last row in the chain, or empty string.