Documentation
¶
Overview ¶
Package audit writes anonymised scan-event records to an append-only log. Operators rotate the file via logrotate / journald; the package itself only cares about anonymisation and serialization.
SPECIFICATIONS.md §9.4 (privacy by design):
- source IP is masked: IPv4 last octet zeroed, IPv6 last 64 bits zeroed
- hostname is hashed (SHA-256, 16-hex-char prefix), never written in clear
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Event ¶
type Event struct {
TimestampUTC time.Time `json:"ts"`
Decision string `json:"decision"`
HostHash string `json:"host_hash"`
IPMasked string `json:"ip_masked"`
ScanID string `json:"scan_id,omitempty"`
Reason string `json:"reason,omitempty"`
}
Event is a structured scan record. Decision is one of "accepted", "blocked", "cached", "cooldown", "rate_limited", "abuse_flagged".
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger appends scan-event records to a writer. Concurrent-safe.
Click to show internal directories.
Click to hide internal directories.