Hi folks,
I’m dealing with a DDoS attack on one of my DNS servers. The attackers are using a broad range patterns in sending the queries. For example:
-
- 5 queries every 5 seconds for about 30s from one IP, or
- 5 queries every 5 seconds for about 30s from one IP, or
-
- 10 queries every 5 seconds for about 1 minute from one IP, or
- 10 queries every 5 seconds for about 1 minute from one IP, or
-
- 1 query per 1 second for about 20s from one IP, or
- 1 query per 1 second for about 20s from one IP, or
-
- around 30 queries per minute with a little randomization in the query distribution for this time frame
My issue comes when I try to mitigate this attack, because they are changing the traffic pattern very often. If I manage to block one pattern, they come with another one. I have over 1000 IPs in a block list.
I modified the patterns as I noticed their changes in traffic but if I want to catch all the patterns I see, I might get rid of the legit traffic too. Can I concatenate many dst-limit patterns? I’m not sure of the outcome yet. Right now, for the latest pattern my filters are:
/ip firewall filter
add action=drop chain=forward comment=“drop from all in dns-flood address list” dst-port=53 protocol=udp src-address-list=dns-flood
add chain=forward comment=“add src IP to dns-flood address list” dst-limit=1,10,src-address/20s dst-port=53 protocol=udp
add action=add-src-to-address-list address-list=dns-flood address-list-timeout=23h59m59s chain=forward dst-port=53 protocol=udpI cannot use the packet rate limit because it will drop the legit requests too since the majority of the traffic is from attackers.
Do you have any hints?
Can the DNS queries be inspected on the query content? I observe the queries are for a limited number of domains every time, so this would be the easiest way of blocking THIS DDoS attack.