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
SqlAuditContext— Audit context (SQL/user/timestamp)SqlAuditor— Audit executor
Structs§
- Async
Audit Writer - Asynchronous audit writer: writes audit logs via a background thread to avoid blocking the main thread.
- Audit
Query - Audit log query filter
- Audit
Rules - Audit rules: allow/deny lists used to decide whether a given SQL statement should be recorded in the audit log.
- File
Audit LogStore - File-based audit log persistent storage (JSONL format: one JSON per line)
- Hash
Chain Auditor - Auditor with a hash chain: all logs are linked by SHA-256 chained hashes, supporting tamper detection.
- Hash
Chain Entry - Audit log entry with a hash chain.
- Rotating
Auditor - Enhanced auditor with rotation policy and audit rules.
- Rotation
Policy - Audit log rotation policy configuration.
- SqlAudit
Context - SqlAuditor
Constants§
- GENESIS_
HASH - Genesis hash (the previous hash of the chain head), fixed as an all-zero 64-character hexadecimal string.
Traits§
- Audit
LogStore - Audit log persistent storage backend trait
Functions§
- query_
logs - Query logs from
SqlAuditorby the given conditions