Documentation
¶
Overview ¶
Package banlog provides centralized ban logging for NFTBan All ban actions (from any source) should log here for stats tracking
Index ¶
Constants ¶
View Source
const ( SourceManual = "manual" SourceLogin = "login" SourcePortscan = "portscan" SourceDDoS = "ddos" SourceFeeds = "feeds" SourceSuricata = "suricata" SourceFail2ban = "fail2ban" // Legacy compatibility )
Source constants for ban log entries
View Source
const ( StatusBanned = "BANNED" StatusUnbanned = "UNBANNED" )
Status constants
Variables ¶
This section is empty.
Functions ¶
func LogBan ¶
LogBan writes a ban entry to the central ban.log Parameters:
- ip: IP address being banned
- source: Ban source (manual, login, portscan, ddos, feeds, suricata)
- country: Country code (e.g., "US", "CN", "UNK" if unknown)
Format: DATE|TIME|SOURCE|IP|COUNTRY|BANNED
func LogBanWithReason ¶
LogBanWithReason writes a ban entry with an optional reason (stored in extended format) This is for detailed logging - the reason is NOT used by stats but is useful for audit
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.