Documentation
¶
Overview ¶
Package fail2ban contains the Fail2ban mechanism for the plugin.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Denylist List `yaml:"denylist"`
Allowlist List `yaml:"allowlist"`
Rules rules.Rules `yaml:"port"`
SourceCriterion SourceCriterion `yaml:"sourceCriterion"`
EnableBlockLogs bool `yaml:"enableBlockLogs"`
// deprecated
Blacklist List `yaml:"blacklist"`
// deprecated
Whitelist List `yaml:"whitelist"`
}
Config struct.
type SourceCriterion ¶ added in v0.9.0
type SourceCriterion struct {
// RequestHeaderName is the HTTP header from which to read the client IP.
// Useful when running behind a proxy/CDN (e.g. "Cf-Connecting-Ip" for Cloudflare).
// When empty, r.RemoteAddr is used.
RequestHeaderName string `yaml:"requestHeaderName"`
}
SourceCriterion defines how to determine the client IP for fail2ban evaluation.
Directories
¶
| Path | Synopsis |
|---|---|
|
pkg
|
|
|
chain
Package chain provides a way to chain multiple http.Handler together.
|
Package chain provides a way to chain multiple http.Handler together. |
|
data
Package data provides a way to store data in the request context.
|
Package data provides a way to store data in the request context. |
|
fail2ban
Package fail2ban provides a fail2ban implementation.
|
Package fail2ban provides a fail2ban implementation. |
|
fail2ban/handler
Package handler provides a fail2ban middleware.
|
Package handler provides a fail2ban middleware. |
|
ipchecking
Package ipchecking wrapper over net/netip to compare both IP and CIRD.
|
Package ipchecking wrapper over net/netip to compare both IP and CIRD. |
|
list/allow
Package allow is a middleware that force allows requests from a list of IP addresses.
|
Package allow is a middleware that force allows requests from a list of IP addresses. |
|
list/deny
Package deny is a middleware that force denies requests from a list of IP addresses.
|
Package deny is a middleware that force denies requests from a list of IP addresses. |
|
logger
Package logger provides structured JSON logging for the fail2ban plugin.
|
Package logger provides structured JSON logging for the fail2ban plugin. |
|
response/status
Package status is a middleware that denies requests from the status of the answer
|
Package status is a middleware that denies requests from the status of the answer |
|
rules
Package rules contains the rules for the fail2ban plugin.
|
Package rules contains the rules for the fail2ban plugin. |
|
url/allow
Package allow is a middleware that force allows requests from a list of regexps.
|
Package allow is a middleware that force allows requests from a list of regexps. |
|
url/deny
Package deny is a middleware that force denies requests from a list of IP addresses.
|
Package deny is a middleware that force denies requests from a list of IP addresses. |
|
utils/time
Package time is a wrapper over the stdlib time package.
|
Package time is a wrapper over the stdlib time package. |
Click to show internal directories.
Click to hide internal directories.



