Guard: watch logs, ban misbehaving addresses in Housecarl
Files and the journal, patterns with one <IP>, bounties within a window, bans in a Housecarl ban list with repeat offenders' bans growing; presets for sshd, jarl, housecarl, steward, bind-xfr, postfix-sasl, dovecot, nginx-auth and housecarl-drops; guard run/check/test/status/bans/ban/unban; a Debian package with a sandboxed unit; an end-to-end test with Housecarl. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
d06bf8d531
47 files changed
+4614
No files matched your search
@@ -0,0 +1,36 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"sync"
|
||||
|
||||
"go.yaml.in/yaml/v3"
|
||||
)
|
||||
|
||||
//go:embed presets.yaml
|
||||
var presetsYAML []byte
|
||||
|
||||
// Preset is a built-in watch: patterns, and where the lines usually are.
|
||||
type Preset struct {
|
||||
Description string `yaml:"description"`
|
||||
File string `yaml:"file"`
|
||||
Journal *Journal `yaml:"journal"`
|
||||
Source string `yaml:"source"`
|
||||
Match []string `yaml:"match"`
|
||||
Ignore []string `yaml:"ignore"`
|
||||
}
|
||||
|
||||
// Presets are the built-in presets by name.
|
||||
var Presets = sync.OnceValue(func() map[string]Preset {
|
||||
out := map[string]Preset{}
|
||||
if err := yaml.Unmarshal(presetsYAML, &out); err != nil {
|
||||
panic("presets.yaml: " + err.Error())
|
||||
}
|
||||
return out
|
||||
})
|
||||
|
||||
//go:embed example.yaml
|
||||
var exampleYAML []byte
|
||||
|
||||
// Example is a commented configuration (guard config --example).
|
||||
func Example() string { return string(exampleYAML) }
|
||||
Reference in new issue
Block a user