Documentation
¶
Index ¶
Constants ¶
View Source
const ( //HostBruteLoginRecordReg = `^.*pam_unix\(sshd:auth\): authentication failure.*rhost=(\S*)\s+.*$` //HostBruteLoginRecordReg = `^.*pam_unix\(sshd:auth\): authentication failure.*rhost=(\S*)` HostBruteLoginRecordReg = `^.*pam_unix\(sshd:.+\):.*rhost=(\S*)` )
Variables ¶
View Source
var ( // Error InvalidIpv4Address = fmt.Errorf("invalid ipv4 address") NoHostRecord = fmt.Errorf("no record of this host") )
View Source
var ( SecurePath = "/var/log/secure" //hostBruteLoginRecordWithUserMatch = regexp.MustCompile(HostBruteLoginRecordWithUserReg).FindStringSubmatch Hosts = NewHosts() Threshold = 5 )
Functions ¶
func WatchAlarm ¶
func WatchSecure ¶
Types ¶
type Host ¶
type Host struct {
// contains filtered or unexported fields
}
func (*Host) AddAuthFailCount ¶
func (h *Host) AddAuthFailCount()
func (*Host) ResetAuthFailCount ¶
func (h *Host) ResetAuthFailCount()
func (*Host) ResetMarkTime ¶
func (h *Host) ResetMarkTime()
func (Host) ThresholdReached ¶
type VisitHosts ¶
type VisitHosts struct {
// contains filtered or unexported fields
}
func NewHosts ¶
func NewHosts() *VisitHosts
func (*VisitHosts) AuthFailed ¶
func (hs *VisitHosts) AuthFailed(ipv4 string, threshold int) error
func (*VisitHosts) ResetHostFailCount ¶
func (hs *VisitHosts) ResetHostFailCount(ipv4 string) error
func (*VisitHosts) ResetHostRecord ¶
func (hs *VisitHosts) ResetHostRecord(ipv4 string) error
Click to show internal directories.
Click to hide internal directories.