mirror of
https://github.com/fail2ban/fail2ban.git
synced 2026-03-11 08:55:31 +00:00
also introduced action.d/common.conf to contain some common definitions to be used in other action files. Similar setup to filter.d/
79 lines
2.1 KiB
Text
79 lines
2.1 KiB
Text
# Fail2Ban configuration file
|
|
#
|
|
# Author: Cyril Jaquier
|
|
# Modified: Yaroslav Halchenko
|
|
# Modified by Paul J aka Thanat0s for ipv6 support
|
|
#
|
|
|
|
[INCLUDES]
|
|
|
|
# Read common definitions, e.g. for %(iptables)s.
|
|
before = common.conf
|
|
|
|
[Definition]
|
|
|
|
# Option: actionstart
|
|
# Notes.: command executed once at the start of Fail2Ban.
|
|
# Values: CMD
|
|
#
|
|
actionstart = %(iptables)s -N fail2ban-<name>
|
|
%(iptables)s -A fail2ban-<name> -j RETURN
|
|
%(iptables)s -I <chain> -p <protocol> --dport <port> -j fail2ban-<name>
|
|
|
|
# Option: actionstop
|
|
# Notes.: command executed once at the end of Fail2Ban
|
|
# Values: CMD
|
|
#
|
|
actionstop = %(iptables)s -D <chain> -p <protocol> --dport <port> -j fail2ban-<name>
|
|
%(iptables)s -F fail2ban-<name>
|
|
%(iptables)s -X fail2ban-<name>
|
|
|
|
# Option: actioncheck
|
|
# Notes.: command executed once before each actionban command
|
|
# Values: CMD
|
|
#
|
|
actioncheck = %(iptables)s -n -L <chain> | grep -q 'fail2ban-<name>[ \t]'
|
|
|
|
# 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 = %(iptables)s -I fail2ban-<name> 1 -s <ip> -j DROP
|
|
|
|
# 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
|
|
#
|
|
actionunban = %(iptables)s -D fail2ban-<name> -s <ip> -j DROP
|
|
|
|
[Init]
|
|
|
|
# Defaut name of the chain
|
|
#
|
|
name = default
|
|
|
|
# Option: port
|
|
# Notes.: specifies port to monitor
|
|
# Values: [ NUM | STRING ] Default:
|
|
#
|
|
port = ssh
|
|
|
|
# Option: protocol
|
|
# Notes.: internally used by config reader for interpolations.
|
|
# Values: [ tcp | udp | icmp | all ] Default: tcp
|
|
#
|
|
protocol = tcp
|
|
|
|
# Option: chain
|
|
# Notes specifies the fail2ban-iptables chain to which the fail2ban rules should be
|
|
# added
|
|
# Values: STRING Default: INPUT
|
|
chain = INPUT
|