Documentation
¶
Overview ¶
Package audit writes the console's append-only JSONL audit trail. One record per event; never secrets and never row data.
Index ¶
Constants ¶
View Source
const ( EventLogin = "login" EventPolicy = "policy" // policy change, applied or refused (see Decision) EventRefused = "refused" // plan refused by the classifier, the tier or the weight check EventApproved = "approved" // the human approved EventDenied = "denied" // the human denied EventTimeout = "timeout" // approval timed out EventAbandoned = "abandoned" // the client left while its approval was pending EventAuto = "auto" // auto-approved under --skip-permissions EventCatalog = "catalog" // catalog read EventLogout = "logout" )
Events, spec §15.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
Log appends records to <stateDir>/locksql/audit.log. The file is opened in append mode for each record, so it is never truncated and never held open.
type Record ¶
type Record struct {
Event string `json:"event"`
Profile string `json:"profile,omitempty"`
Engine string `json:"engine,omitempty"`
Host string `json:"host,omitempty"`
DB string `json:"db,omitempty"`
DBUser string `json:"db_user,omitempty"`
Class string `json:"class,omitempty"`
SQL string `json:"sql,omitempty"`
Verdict string `json:"verdict,omitempty"`
Decision string `json:"decision,omitempty"`
Error string `json:"error,omitempty"`
Rows int64 `json:"rows,omitempty"`
Affected int64 `json:"affected,omitempty"`
DurationMS int64 `json:"duration_ms,omitempty"`
Truncated bool `json:"truncated,omitempty"`
Unmasked bool `json:"unmasked,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
Record is one audit event. It has no field able to hold a password or row data: Error must already be sanitised by the caller.
Click to show internal directories.
Click to hide internal directories.