DDoS, WAFs & Mitigation
Transcript
Made automatically from the video's sound, so it may contain mistakes. Click a line to play from there.
Right, let's dive straight into the architecture of network and application defense. In this explainer, we're stripping away all the beginner metaphors to look at the mechanical reality of DDoS mitigation, web application firewalls, and rate limiting. We're talking strictly to engineers who already understand edge ingress, so we are jumping right into the DPEM today.
Here's our roadmap for the session. We'll be covering the infrastructure threat model, layer 3 volumetric attacks, layer 7 application attacks, web application firewalls, the OWASP core rule set, and finally rate limiting execution.
Let's get right to it. The infrastructure threat model. At its foundation, a distributed denial of service, or DDoS attack, is really just an exercise in scale.
The core mechanism relies on a botnet, and today, you know, this frequently includes thousands of vulnerable IoT devices. Yes, we are literally talking about compromised smart fridges and toasters executing remote instructions to simultaneously flood a single target IP address.
It's wild, but it's the reality. A severe resource disparity. Think about it. It costs an attacker practically nothing to trigger automated scripts across a botnet.
However, for the target, for us, absorbing or mitigating that massive influx demands incredibly expensive network bandwidth and server compute capacity. It is, by definition, a highly asymmetric war. So let's look at section two, layer three volumetric attacks.
Notice the connectionless nature of OSI Layer 3. Attacks at this level exploit protocols like ICMP or IPsec to target your routing equipment directly. Because it's connectionless, the attacker completely bypasses the need to establish a TCP handshake.
They just fire and forget, aiming to totally clog the pipes before the traffic ever has a chance to reach your application servers. A classic example of this is the Smurf attack. Now, while modern hardware is largely mitigated legacy vectors like the ping of death or basic TCP SYN state exhaustion, the Smurf attack really highlights the inherent dangers of UDP or ICMP protocols that lack built-in verification.
By spoofing the target's IP address in a request, an attacker can essentially trick thousands of external servers into reflecting their responses directly at the victim, massively amplifying the flood. To mitigate these massive volumetric floods, modern infrastructure relies on a really rigid pipeline.
First, any cast diffusion scatters and absorbs the sheer bandwidth across a global network. Second, black hole routing and eBPF packet dropping are used to filter out the obvious junk traffic.
And finally, strict CDN edge filtering locks ingress exclusively to layer 7 ports, typically ports 80 and 443. So the absolutely crucial point here is this. What happens when attackers realize they actually don't need 300 gigabits per second of bandwidth to take down your architecture?
What if they just need to send a small amount of traffic through those open, legitimate layer 7 ports? Layer 7 application attacks. At the application layer, the attack economics change entirely.
An attacker doesn't need to clog your bandwidth with highly obvious junk data anymore. Instead, they require very low bandwidth to target your most expensive server compute.
They aim directly at uncached origin search functions or login endpoints, forcing your origin server to process complex API calls and heavy database queries until it simply collapses under the weight. The most common vector you'll see here is the HTTP flood, and it is incredibly insidious, because the traffic isn't spoofed.
It originates from real established TCP connections, generating seemingly valid GET and POST requests. Trying to distinguish this malicious botnet traffic from a sudden spike in legitimate human users?
Yeah, that's incredibly difficult without doing deep payload inspection. Web application firewalls. Sitting directly in front of your application, a WAF operates as a layer 7 reverse proxy.
It intercepts the internal execution pipeline, requiring absolutely all clients to pass through it before reaching the origin server. It handles the TLS decryption, normalizes the HTTP request, and executes a set of rules to evaluate every single payload.
It's specifically hunting for things like cross-site scripting, SQL injection, and cross-site request forgery before it decides if it should block, log, or challenge the request. When defining WAF policies, engineers are faced with a fundamental architectural choice.
Do you implement a negative security model, a block list, that drops requests matching known attack signatures, or do you enforce a positive security model, an allow list, that explicitly only admits pre-approved, strictly defined traffic. In modern real-world deployments, it's almost always a hybrid of both, to balance robust security with actual operational reality.
When engineering this into production, you always have to balance latency, compute, and cost. Network-based hardware offers minimal latency, but comes at the absolute highest capital expense.
Host based software consumes your local server compute and risks nasty latency spikes. Meanwhile, cloud based WAFs offer a turnkey zero maintenance SAS deployment, managing routing with minimal local impact, effectively moving security and heavy payload inspection right to the edge.
And crucially, this allows you to lock your origin security groups strictly to the CDN's IP ranges, or enforce MTLS. Let's move to section 5, the OWASP Core Rules Set. The OWASP Core Rules Set, or CRS, is the industry standard open source collection of signatures.
It's cleverly engineered to provide generic attack detection while keeping false positives to an absolute minimum. Because, let's face it, accidentally blocking legitimate JSON payloads or valid application code is a massive production headache.
It acts as a really critical defense in depth layer, frequently relying on anomaly scoring rather than just immediately handing out binary blocks. Now, any seasoned engineer knows that updating rulesets can break applications. For production stability, the CRS project guarantees that minor releases will strictly contain bug fixes.
They restrict any breaking changes or heavy regular expression modifications strictly to major version rollouts. This allows your team to update safely without causing unexpected REDOS latency spikes or blocking valid traffic.
Finally, section 6. Rate limiting execution. This is where rate limiting steps in. It operates by continuously tracking the time elapsed between requests from specific client identifiers, whether you're using a sliding window counter or a token bucket algorithm.
This calculation happens locally at the edge data center. If a predefined request threshold is breached within that time window, the system automatically executes a temporary block action against that specific client. By enforcing strict thresholds, rate limiting mathematically neutralizes several critical attack vectors.
It stops brute force credential stuffing dead in its tracks, it prevents aggressive data scraping bots from hammering your databases, and crucially it stops third party developers or malicious actors from completely bankrupting your API compute budget. But remember, good architecture requires nuance.
If you only rate limit by IP address, a distributed botnet can effortlessly bypass your threshold by rotating through thousands of IP addresses to attack a single account. Effective rate limiting on sensitive endpoints like logins must use NATSafe composite keys, combining the IP address with the target username, or even a TLS fingerprint to ensure comprehensive coverage.
Which leaves us with a critical engineering question to close out this explainer. Basic rate limiting is static, right? It cannot distinguish between a highly active human power user and an automated script.
As attackers deploy increasingly sophisticated tooling, how will you evolve your infrastructure from static rate limiting to dynamic machine learning driven bot mitigation? It is absolutely the next frontier in edge defense, and it's something every single infrastructure engineer needs to be planning for today.
Thanks for joining me on this deep dive.