silencer

command module
v0.0.0-...-dfaed72 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2022 License: BSD-2-Clause Imports: 11 Imported by: 0

README

About

Silencer is a simple replacement for fail2ban written in Go.

After several hours of unsuccessful configuring of fail2ban I gave up and decided to build my own.

Running


silencer [-config silencer.yaml] [-debug-rule] [-dry-run]

Configuration

The configuration is stored in YAML file. During startup silencer will try to read "silencer.yaml" in the current directory. It is possible to override location via -config option.

log_file section defines a collection of log files to monitor and rules attached to them. Rules are used to match and extract IP address from a log line.

Rule matching works by using a sequence of regexes to match and trim line until only IP remains. If the regex fails to match, then the rule is considered failed, and no more matching is performed. If regex contains capture group, then log line will be replaced with the value of capture group.

env section defines commons strings. All regexes are expanded using these strings.

Building & testing

git clone https://github.com/delamonpansie/silencer
cd silencer
go get github.com/golang/mock/mockgen
go generate ./...
go test ./...
go build .

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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