Documentation
¶
Overview ¶
Package audit records an immutable, structured trail of handled requests.
A Record is emitted per audited request through a pluggable Sink. Sink implementations live in subpackages (see sink/file); tamper-resistance (retention, WORM) is delegated to the storage records are shipped to (append-only file, WORM bucket, SIEM), not enforced in-process.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Record ¶
type Record struct {
Time time.Time `json:"time"`
RequestID string `json:"request_id"`
Username string `json:"username,omitempty"`
ClientIP string `json:"client_ip"`
Method string `json:"method"`
Path string `json:"path"`
Error string `json:"error,omitempty"`
Status int `json:"status"`
Duration time.Duration `json:"duration_ns"`
}
Record is a single audit entry describing one handled request.
Directories
¶
| Path | Synopsis |
|---|---|
|
sink
|
|
|
file
Package file implements an audit.Sink that appends records as newline-delimited JSON to a file, rotating the file by size.
|
Package file implements an audit.Sink that appends records as newline-delimited JSON to a file, rotating the file by size. |
|
log
Package log implements an audit.Sink that writes records through a zap logger.
|
Package log implements an audit.Sink that writes records through a zap logger. |
Click to show internal directories.
Click to hide internal directories.