mirror of
https://github.com/fail2ban/fail2ban.git
synced 2026-03-11 08:55:31 +00:00
# Conflicts: # fail2ban/server/database.py # fail2ban/tests/fail2banclienttestcase.py # fail2ban/tests/sockettestcase.py
63 lines
1.6 KiB
Text
63 lines
1.6 KiB
Text
# Fail2Ban action file for firewall-cmd/ipset
|
|
#
|
|
# This requires:
|
|
# ipset (package: ipset)
|
|
# firewall-cmd (package: firewalld)
|
|
#
|
|
# This is for ipset protocol 6 (and hopefully later) (ipset v6.14).
|
|
# Use ipset -V to see the protocol and version.
|
|
#
|
|
# IPset was a feature introduced in the linux kernel 2.6.39 and 3.0.0 kernels.
|
|
#
|
|
# If you are running on an older kernel you make need to patch in external
|
|
# modules.
|
|
|
|
[INCLUDES]
|
|
|
|
before = firewallcmd-common.conf
|
|
|
|
[Definition]
|
|
|
|
actionstart = ipset create <ipmset> hash:ip timeout <default-timeout><familyopt>
|
|
firewall-cmd --direct --add-rule <family> filter <chain> 0 -p <protocol> -m multiport --dports <port> -m set --match-set <ipmset> src -j <blocktype>
|
|
|
|
actionflush = ipset flush <ipmset>
|
|
|
|
actionstop = firewall-cmd --direct --remove-rule <family> filter <chain> 0 -p <protocol> -m multiport --dports <port> -m set --match-set <ipmset> src -j <blocktype>
|
|
<actionflush>
|
|
ipset destroy <ipmset>
|
|
|
|
actionban = ipset add <ipmset> <ip> timeout <bantime> -exist
|
|
|
|
actionprolong = %(actionban)s
|
|
|
|
actionunban = ipset del <ipmset> <ip> -exist
|
|
|
|
[Init]
|
|
|
|
# Option: chain
|
|
# Notes specifies the iptables chain to which the fail2ban rules should be
|
|
# added
|
|
# Values: [ STRING ]
|
|
#
|
|
chain = INPUT_direct
|
|
|
|
# Option: default-timeout
|
|
# Notes: specifies default timeout in seconds (handled default ipset timeout only)
|
|
# Values: [ NUM ] Default: 600
|
|
|
|
default-timeout = 600
|
|
|
|
ipmset = f2b-<name>
|
|
familyopt =
|
|
|
|
[Init?family=inet6]
|
|
|
|
ipmset = f2b-<name>6
|
|
familyopt = <sp>family inet6
|
|
|
|
|
|
# DEV NOTES:
|
|
#
|
|
# Author: Edgar Hoch and Daniel Black
|
|
# firewallcmd-new / iptables-ipset-proto6 combined for maximium goodness
|