Running a LEMP server on ubuntu 20.04 with firewalld as the firewall. Some Wordpress sites are installed. Sometimes an ip is hammering the xmlrpc.php creating higher loads.
To block an ip: firewall-cmd --permanent --add-rich-rule="rule family=ipv4 source address=20.211.91.32/32 reject" according to this guide
Running: firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: eth0
sources:
services: dhcpv6-client ssh
ports: 110/tcp 443/tcp 80/tcp 2222/tcp 587/tcp 25/tcp 35000-35999/tcp 143/tcp 21/tcp 22/tcp 53/tcp 995/tcp 53/udp 993/tcp 2053/tcp 2087/tcp 8443/tcp 5349/tcp 49152-65535/udp 5349/udp 2083/tcp
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
rule family="ipv4" source address="20.211.91.32/32" reject
Running: iptables --list
Chain IN_public_deny (1 references)
target prot opt source destination
REJECT all -- 20.211.91.32 anywhere reject-with icmp-port-unreachable
And still the ip is able to make https requests when checking the log
20.211.91.32 - - [10/Apr/2022:15:42:07 +0200] "POST //xmlrpc.php HTTP/2.0" 200 235 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"
Why is firewalld not blocking these https requests?