Skip to main content

Crate sz_orm_audit

Crate sz_orm_audit 

Source
Expand description

§SZ-ORM Audit — SQL Audit Log

Provides SQL execution audit records and performs case-insensitive masking on sensitive keywords such as password/token/credit_card, ensuring that audit logs never leak sensitive information.

§Main Types

Structs§

AsyncAuditWriter
Asynchronous audit writer: writes audit logs via a background thread to avoid blocking the main thread.
AuditQuery
Audit log query filter
AuditRules
Audit rules: allow/deny lists used to decide whether a given SQL statement should be recorded in the audit log.
FileAuditLogStore
File-based audit log persistent storage (JSONL format: one JSON per line)
HashChainAuditor
Auditor with a hash chain: all logs are linked by SHA-256 chained hashes, supporting tamper detection.
HashChainEntry
Audit log entry with a hash chain.
RotatingAuditor
Enhanced auditor with rotation policy and audit rules.
RotationPolicy
Audit log rotation policy configuration.
SqlAuditContext
SqlAuditor

Constants§

GENESIS_HASH
Genesis hash (the previous hash of the chain head), fixed as an all-zero 64-character hexadecimal string.

Traits§

AuditLogStore
Audit log persistent storage backend trait

Functions§

query_logs
Query logs from SqlAuditor by the given conditions