|
|
|
@ -1597,12 +1597,12 @@ class ServerConfigReaderTests(LogCaptureTestCase):
|
|
|
|
|
"`done`",
|
|
|
|
|
),
|
|
|
|
|
'ip4-start': (
|
|
|
|
|
"`ipset -exist create f2b-j-w-iptables-ipset hash:ip timeout 0 `",
|
|
|
|
|
"`ipset -exist create f2b-j-w-iptables-ipset hash:ip timeout 0 maxelem 65536 `",
|
|
|
|
|
"`{ iptables -w -C INPUT -p $proto -m multiport --dports http -m set --match-set f2b-j-w-iptables-ipset src -j REJECT --reject-with icmp-port-unreachable >/dev/null 2>&1; } || "
|
|
|
|
|
"{ iptables -w -I INPUT -p $proto -m multiport --dports http -m set --match-set f2b-j-w-iptables-ipset src -j REJECT --reject-with icmp-port-unreachable; }`",
|
|
|
|
|
),
|
|
|
|
|
'ip6-start': (
|
|
|
|
|
"`ipset -exist create f2b-j-w-iptables-ipset6 hash:ip timeout 0 family inet6`",
|
|
|
|
|
"`ipset -exist create f2b-j-w-iptables-ipset6 hash:ip timeout 0 maxelem 65536 family inet6`",
|
|
|
|
|
"`{ ip6tables -w -C INPUT -p $proto -m multiport --dports http -m set --match-set f2b-j-w-iptables-ipset6 src -j REJECT --reject-with icmp6-port-unreachable >/dev/null 2>&1; } || "
|
|
|
|
|
"{ ip6tables -w -I INPUT -p $proto -m multiport --dports http -m set --match-set f2b-j-w-iptables-ipset6 src -j REJECT --reject-with icmp6-port-unreachable; }`",
|
|
|
|
|
),
|
|
|
|
@ -1646,12 +1646,12 @@ class ServerConfigReaderTests(LogCaptureTestCase):
|
|
|
|
|
"`done`",
|
|
|
|
|
),
|
|
|
|
|
'ip4-start': (
|
|
|
|
|
"`ipset -exist create f2b-j-w-iptables-ipset-ap hash:ip timeout 0 `",
|
|
|
|
|
"`ipset -exist create f2b-j-w-iptables-ipset-ap hash:ip timeout 0 maxelem 65536 `",
|
|
|
|
|
"`{ iptables -w -C INPUT -p $proto -m set --match-set f2b-j-w-iptables-ipset-ap src -j REJECT --reject-with icmp-port-unreachable >/dev/null 2>&1; } || "
|
|
|
|
|
"{ iptables -w -I INPUT -p $proto -m set --match-set f2b-j-w-iptables-ipset-ap src -j REJECT --reject-with icmp-port-unreachable; }",
|
|
|
|
|
),
|
|
|
|
|
'ip6-start': (
|
|
|
|
|
"`ipset -exist create f2b-j-w-iptables-ipset-ap6 hash:ip timeout 0 family inet6`",
|
|
|
|
|
"`ipset -exist create f2b-j-w-iptables-ipset-ap6 hash:ip timeout 0 maxelem 65536 family inet6`",
|
|
|
|
|
"`{ ip6tables -w -C INPUT -p $proto -m set --match-set f2b-j-w-iptables-ipset-ap6 src -j REJECT --reject-with icmp6-port-unreachable >/dev/null 2>&1; } || "
|
|
|
|
|
"{ ip6tables -w -I INPUT -p $proto -m set --match-set f2b-j-w-iptables-ipset-ap6 src -j REJECT --reject-with icmp6-port-unreachable; }",
|
|
|
|
|
),
|
|
|
|
@ -1979,11 +1979,11 @@ class ServerConfigReaderTests(LogCaptureTestCase):
|
|
|
|
|
('j-w-fwcmd-ipset', 'firewallcmd-ipset[name=%(__name__)s, port="http", protocol="tcp", chain="<known/chain>"]', {
|
|
|
|
|
'ip4': (' f2b-j-w-fwcmd-ipset ',), 'ip6': (' f2b-j-w-fwcmd-ipset6 ',),
|
|
|
|
|
'ip4-start': (
|
|
|
|
|
"`ipset -exist create f2b-j-w-fwcmd-ipset hash:ip timeout 0 `",
|
|
|
|
|
"`ipset -exist create f2b-j-w-fwcmd-ipset hash:ip timeout 0 maxelem 65536 `",
|
|
|
|
|
"`firewall-cmd --direct --add-rule ipv4 filter INPUT_direct 0 -p tcp -m multiport --dports http -m set --match-set f2b-j-w-fwcmd-ipset src -j REJECT --reject-with icmp-port-unreachable`",
|
|
|
|
|
),
|
|
|
|
|
'ip6-start': (
|
|
|
|
|
"`ipset -exist create f2b-j-w-fwcmd-ipset6 hash:ip timeout 0 family inet6`",
|
|
|
|
|
"`ipset -exist create f2b-j-w-fwcmd-ipset6 hash:ip timeout 0 maxelem 65536 family inet6`",
|
|
|
|
|
"`firewall-cmd --direct --add-rule ipv6 filter INPUT_direct 0 -p tcp -m multiport --dports http -m set --match-set f2b-j-w-fwcmd-ipset6 src -j REJECT --reject-with icmp6-port-unreachable`",
|
|
|
|
|
),
|
|
|
|
|
'flush': (
|
|
|
|
@ -2015,11 +2015,11 @@ class ServerConfigReaderTests(LogCaptureTestCase):
|
|
|
|
|
('j-w-fwcmd-ipset-ap', 'firewallcmd-ipset[name=%(__name__)s, actiontype=<allports>, protocol="tcp", chain="<known/chain>"]', {
|
|
|
|
|
'ip4': (' f2b-j-w-fwcmd-ipset-ap ',), 'ip6': (' f2b-j-w-fwcmd-ipset-ap6 ',),
|
|
|
|
|
'ip4-start': (
|
|
|
|
|
"`ipset -exist create f2b-j-w-fwcmd-ipset-ap hash:ip timeout 0 `",
|
|
|
|
|
"`ipset -exist create f2b-j-w-fwcmd-ipset-ap hash:ip timeout 0 maxelem 65536 `",
|
|
|
|
|
"`firewall-cmd --direct --add-rule ipv4 filter INPUT_direct 0 -p tcp -m set --match-set f2b-j-w-fwcmd-ipset-ap src -j REJECT --reject-with icmp-port-unreachable`",
|
|
|
|
|
),
|
|
|
|
|
'ip6-start': (
|
|
|
|
|
"`ipset -exist create f2b-j-w-fwcmd-ipset-ap6 hash:ip timeout 0 family inet6`",
|
|
|
|
|
"`ipset -exist create f2b-j-w-fwcmd-ipset-ap6 hash:ip timeout 0 maxelem 65536 family inet6`",
|
|
|
|
|
"`firewall-cmd --direct --add-rule ipv6 filter INPUT_direct 0 -p tcp -m set --match-set f2b-j-w-fwcmd-ipset-ap6 src -j REJECT --reject-with icmp6-port-unreachable`",
|
|
|
|
|
),
|
|
|
|
|
'flush': (
|
|
|
|
|