utils

package
v0.0.0-...-40a32e1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const FAILED_EVENTS_TABLE = "failedEvents"
View Source
const FAILED_IPS_TABLE = "failedIPs"

Variables

View Source
var BinSh = "/bin/sh"
View Source
var C = "-c"
View Source
var LAST_TIME_LOGGED = map[string]int64{}

Functions

func GenerateTimestampUUID

func GenerateTimestampUUID() (string, error)

func GenerateUUID

func GenerateUUID() (string, error)

func LogBannedIPs

func LogBannedIPs(dataStorage *storage.GenericStorage) error

func RetrieveEventsForIP

func RetrieveEventsForIP(dataStorage *storage.GenericStorage, ip string) (map[string]*Event, error)

func RetrieveIPs

func RetrieveIPs(dataStorage *storage.GenericStorage) ([]string, error)

func RunCommandGetOutput

func RunCommandGetOutput(command string) (string, error)

func StoreBannedIP

func StoreBannedIP(dataStorage *storage.GenericStorage, event *Event, ttl int64) error

Types

type Event

type Event struct {
	ID       string
	IP       string
	Priority string
}

func CreateSimpleEvent

func CreateSimpleEvent(remoteAddress string) (*Event, error)

type Fail2BanData

type Fail2BanData struct {
	DataStorage   *storage.GenericStorage
	RemoteAddress string
	TTL           int64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL