jezahost
  • ddos
  • security
  • firewall
  • network

Why an ordinary firewall cannot stop a DDoS attack

The ports are closed and there is a strong firewall, yet a DDoS still takes the site and the network down. Why the link fills up before the firewall, how the firewall itself becomes the target, the three kinds of attack and what really helps.

When DDoS comes up, the two answers we hear most often are "We have a firewall" and "All ports are closed, nothing unnecessary is open". Both are good security practice. But neither protects against DDoS.

In this post we explain why in plain words and show what really helps.

The port is closed, so we are protected?

This is the most widespread misconception. What does a closed port mean? A packet reaches the firewall, the firewall inspects it and drops it. In other words:

  • the packet has already travelled the whole way from the provider to you;
  • it has taken up room on your internet link;
  • the firewall had to process it, if only to drop it.

A DDoS attack targets an address, not a port. The attacker does not want to get into a service, but to fill up the link and the equipment. So it makes no difference to them that the packets go to a closed port. Often the attack is sent to random ports anyway.

Worse still are "reflection" attacks. The attacker sends small requests in your name to thousands of DNS or NTP servers on the internet, and they send large replies back to you. These packets arrive on ports you never opened and fill the link all the same.

Closing ports matters against break-in attempts. Against DDoS it gives you almost nothing.

Imagine a thin water pipe into a house that can carry at most 1 litre of water per second, and the best filter fitted inside the house. If 10 litres per second are suddenly pushed into the pipe, the quality of the filter changes nothing: the blockage is outside the house, in the pipe itself.

Networks work the same way. If the internet line of an office or a server is 1 Gbit/s, a 10 Gbit/s attack fills the provider's line to you before it ever reaches the firewall. However strong the firewall is, it cannot filter a packet that never gets to it. Meanwhile, the packets of normal users are lost in that same blockage.

Today's DDoS attacks are tens, sometimes hundreds of gigabits in size. A volume like that can only be stopped higher up in the network, at the level of the provider or a large carrier.

The firewall itself becomes the target

Even if the link does not fill up, the firewall can fail under its own load:

  • State table. The firewall remembers every connection. Millions of fake connection attempts per second fill this table, and no room is left for new, normal connections.
  • Packet rate. A firewall's capacity is measured not only in gigabits but also in packets per second. An attack with small packets looks light in terms of traffic, yet it maxes out the processor.
  • Logging. If a log line is written for every dropped packet, during an attack the disk and the processor are spent on just that.

This is the paradox: the "smarter" a security appliance works, the more time it spends on each packet, and the faster it wears out in front of a DDoS.

Three kinds of attack

To build the defence correctly, you need to know which kind of attack you are facing:

  1. Volumetric attacks. The goal is to fill the link (UDP floods, DNS and NTP reflection). Their size is measured in gigabits. They can only be stopped at the provider level.
  2. Protocol attacks. The goal is to exhaust the equipment's resources (SYN floods, half-open connections). The right firewall settings can partly reduce them.
  3. Application-layer attacks. The site receives requests that look normal, but in very large numbers. The traffic may be small, but the web server and the database grind to a halt. Here a CDN, a WAF and request limits help.

What really helps

1. Talk to your provider in advance. Before an attack starts, find out what the provider can do during one. Can they apply filters, can they temporarily block the address under attack (RTBH), do they have a scrubbing service? Know whom you will call during an attack and what you will write.

2. Keep the website behind a CDN (for example, Cloudflare). A CDN absorbs the attack on its own large network and hides your server's real address. For this to work, the real address must not show up anywhere: in old DNS records, in mail headers, in subdomains.

3. Do not expose unnecessary services to the internet. This does not stop a DDoS, but it makes the target smaller. Open DNS, NTP and SNMP servers in particular can be used as tools in attacks on others.

4. Configure the firewall correctly. Turn on SYN cookies or a SYN proxy, limit the number of connections from one source, and reduce the logging of dropped packets during an attack. Never expose the management interface to the internet.

5. Know your normal traffic. What is the normal daily volume, how many packets per second, which countries does it come from? A team that does not know this notices an attack late and does not know what to filter. Even simple monitoring makes a big difference.

6. Write a plan. One page is enough: how we recognise an attack, whom we call, what we tell customers, which services we can switch off temporarily. During an attack there is no time to think.

In short

A firewall is an important part of security, but it is only the last link in DDoS defence. An attack has to be stopped higher up, before the link fills. That is why the chain of defence is built like this: filtering at the provider level, a CDN for the web, correct firewall settings, monitoring and a ready plan.

Where the server sits is also part of this chain. A server in a data centre is closer to the provider's network and benefits sooner from measures taken higher up during an attack. An office's single internet line, on the other hand, is the first thing an attack fills.