diff --git a/ChangeLog b/ChangeLog index 66539a37..09be05be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,8 +18,12 @@ ver. 1.1.1-dev-1 (20??/??/??) - development nightly edition * `paths-debian.conf`: - default banactions are `nftables` - sshd backend switched to `systemd` (gh-3292) +* `action.d/firewallcmd-ipset.conf`: + - rename `ipsettype` to `ipsetbackend` (gh-2620), parameter `ipsettype` will be used now to the real set type (gh-3760) ### New Features and Enhancements +* `action.d/*-ipset.conf`: + - parameter `ipsettype` to set type of ipset, e. g. hash:ip, hash:net, etc (gh-3760) ver. 1.1.0 (2024/04/25) - object-found--norad-59479-cospar-2024-069a--altitude-36267km diff --git a/config/action.d/firewallcmd-ipset.conf b/config/action.d/firewallcmd-ipset.conf index c5282c62..ed498084 100644 --- a/config/action.d/firewallcmd-ipset.conf +++ b/config/action.d/firewallcmd-ipset.conf @@ -18,24 +18,24 @@ before = firewallcmd-common.conf [Definition] -actionstart = /actionstart> +actionstart = /actionstart> firewall-cmd --direct --add-rule filter 0 -m set --match-set src -j -actionflush = /actionflush> +actionflush = /actionflush> actionstop = firewall-cmd --direct --remove-rule filter 0 -m set --match-set src -j - /actionstop> + /actionstop> -actionban = /actionban> +actionban = /actionban> # actionprolong = %(actionban)s -actionunban = /actionunban> +actionunban = /actionunban> -[ipstype_ipset] +[ipsbackend_ipset] -actionstart = ipset -exist create hash:ip timeout maxelem +actionstart = ipset -exist create timeout maxelem actionflush = ipset flush @@ -45,9 +45,9 @@ actionban = ipset -exist add timeout actionunban = ipset -exist del -[ipstype_firewalld] +[ipsbackend_firewalld] -actionstart = firewall-cmd --direct --new-ipset= --type=hash:ip --option=timeout= --option=maxelem= +actionstart = firewall-cmd --direct --new-ipset= --type= --option=timeout= --option=maxelem= # TODO: there doesn't seem to be an explicit way to invoke the ipset flush function using firewall-cmd actionflush = @@ -60,6 +60,11 @@ actionunban = firewall-cmd --ipset= --remove-entry= [Init] +# Option: ipsettype +# Notes: specifies type of set, see `man --pager='less -p "^SET TYPES"' ipset` for details +# Values: hash:ip, hash:net, etc... Default: hash:ip +ipsettype = hash:ip + # Option: chain # Notes specifies the iptables chain to which the fail2ban rules should be # added @@ -87,11 +92,11 @@ maxelem = 65536 # banaction = %(known/banaction)s[ipsettime=''] timeout-bantime = $([ "" -le 2147483 ] && echo "" || echo 0) -# Option: ipsettype -# Notes.: defines type of ipset used for match-set (firewalld or ipset) +# Option: ipsetbackend +# Notes.: defines the backend of ipset used for match-set (firewalld or ipset) # Values: firewalld or ipset # Default: ipset -ipsettype = ipset +ipsetbackend = ipset # Option: actiontype # Notes.: defines additions to the blocking rule diff --git a/config/action.d/iptables-ipset.conf b/config/action.d/iptables-ipset.conf index 07f89415..89d90142 100644 --- a/config/action.d/iptables-ipset.conf +++ b/config/action.d/iptables-ipset.conf @@ -24,7 +24,7 @@ before = iptables.conf # Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false). # Values: CMD # -actionstart = ipset -exist create hash:ip timeout maxelem +actionstart = ipset -exist create timeout maxelem <_ipt_add_rules> # Option: actionflush @@ -66,6 +66,11 @@ rule-jump = -m set --match-set src -j [Init] +# Option: ipsettype +# Notes: specifies type of set, see `man --pager='less -p "^SET TYPES"' ipset` for details +# Values: hash:ip, hash:net, etc... Default: hash:ip +ipsettype = hash:ip + # Option: default-ipsettime # Notes: specifies default timeout in seconds (handled default ipset timeout only) # Values: [ NUM ] Default: 0 (no timeout, managed by fail2ban by unban) diff --git a/config/action.d/shorewall-ipset-proto6.conf b/config/action.d/shorewall-ipset-proto6.conf index fade8107..72e3fea9 100644 --- a/config/action.d/shorewall-ipset-proto6.conf +++ b/config/action.d/shorewall-ipset-proto6.conf @@ -51,7 +51,7 @@ # Values: CMD # actionstart = if ! ipset -quiet -name list f2b- >/dev/null; - then ipset -quiet -exist create f2b- hash:ip timeout maxelem ; + then ipset -quiet -exist create f2b- timeout maxelem ; fi # Option: actionstop @@ -94,6 +94,11 @@ timeout-bantime = $([ "" -le 2147483 ] && echo "" || echo 0) [Init] +# Option: ipsettype +# Notes: specifies type of set, see `man --pager='less -p "^SET TYPES"' ipset` for details +# Values: hash:ip, hash:net, etc... Default: hash:ip +ipsettype = hash:ip + # Option: maxelem # Notes: maximal number of elements which can be stored in the ipset # You may want to increase this for long-duration/high-volume jails