mirror of https://github.com/fail2ban/fail2ban
parent
3e1328c83b
commit
e74047ae49
@ -1,73 +0,0 @@
|
|||||||
# Fail2Ban configuration file
|
|
||||||
#
|
|
||||||
# OpenBSD pf ban/unban
|
|
||||||
#
|
|
||||||
# Author: Nick Hilliard <nick@foobar.org>
|
|
||||||
# Modified by: Alexander Koeppe making PF work seamless and with IPv4 and IPv6
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
[Definition]
|
|
||||||
|
|
||||||
# Option: actionstart
|
|
||||||
# Notes.: command executed once at the start of Fail2Ban.
|
|
||||||
# Values: CMD
|
|
||||||
#
|
|
||||||
# we don't enable PF automatically; to enable run pfctl -e
|
|
||||||
# or add `pf_enable="YES"` to /etc/rc.conf (tested on FreeBSD)
|
|
||||||
actionstart = echo "table <<tablename>-<name>> persist counters" | pfctl -f-
|
|
||||||
echo "block proto <protocol> from <<tablename>-<name>> to any port <port>" | pfctl -f-
|
|
||||||
|
|
||||||
|
|
||||||
# Option: actionstop
|
|
||||||
# Notes.: command executed once at the end of Fail2Ban
|
|
||||||
# Values: CMD
|
|
||||||
#
|
|
||||||
# we only disable PF rules we've installed prior
|
|
||||||
actionstop = pfctl -sr 2>/dev/null | grep -v <tablename>-<name> | pfctl -f-
|
|
||||||
pfctl -t <tablename>-<name> -T flush
|
|
||||||
pfctl -t <tablename>-<name> -T kill
|
|
||||||
|
|
||||||
|
|
||||||
# Option: actioncheck
|
|
||||||
# Notes.: command executed once before each actionban command
|
|
||||||
# Values: CMD
|
|
||||||
#
|
|
||||||
actioncheck = pfctl -sr | grep -q <tablename>-<name>
|
|
||||||
|
|
||||||
|
|
||||||
# Option: actionban
|
|
||||||
# Notes.: command executed when banning an IP. Take care that the
|
|
||||||
# command is executed with Fail2Ban user rights.
|
|
||||||
# Tags: <ip> IP address
|
|
||||||
# <failures> number of failures
|
|
||||||
# <time> unix timestamp of the ban time
|
|
||||||
# Values: CMD
|
|
||||||
#
|
|
||||||
actionban = pfctl -t <tablename>-<name> -T add <ip>
|
|
||||||
|
|
||||||
|
|
||||||
# Option: actionunban
|
|
||||||
# Notes.: command executed when unbanning an IP. Take care that the
|
|
||||||
# command is executed with Fail2Ban user rights.
|
|
||||||
# Tags: <ip> IP address
|
|
||||||
# <failures> number of failures
|
|
||||||
# <time> unix timestamp of the ban time
|
|
||||||
# Values: CMD
|
|
||||||
#
|
|
||||||
# note -r option used to remove matching rule
|
|
||||||
actionunban = pfctl -t <tablename>-<name> -T delete <ip>
|
|
||||||
|
|
||||||
[Init]
|
|
||||||
# Option: tablename
|
|
||||||
# Notes.: The pf table name.
|
|
||||||
# Values: [ STRING ]
|
|
||||||
#
|
|
||||||
tablename = f2b
|
|
||||||
|
|
||||||
# Option: protocol
|
|
||||||
# Notes.: internally used by config reader for interpolations.
|
|
||||||
# Values: [ tcp | udp | icmp | ipv6-icmp ] Default: tcp
|
|
||||||
#
|
|
||||||
protocol = tcp
|
|
||||||
|
|
Loading…
Reference in new issue