

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: DoS
incomplete
2: Rate Limiting
incomplete
3: Protecting Auth from Abuse
incomplete
4: Throttling Requests
incomplete
5: Queuing Work
incomplete
6: Resource Limits
incomplete
7: Timeouts
incomplete
8: Usage Quotas
incomplete
9: DDoS
incomplete
10: Mitigating DDoS
incomplete
11: Bot Detection
incomplete
12: CAPTCHA
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
A Denial-of-Service (DoS) attack isn't like most "hacks"... it has nothing to do with "breaking in." It's about overwhelming a system so its regular users can't use it.
Attackers use DoS for extortion, sabotage, or distraction while they exploit another vulnerability.
A "regular" DoS attack comes from a single source. It's a flood of requests – sometimes hundreds, thousands, or even millions per second – that can overwhelm your server's ability to respond to anything else.
I've DoS'd myself by accident by running a local script against my own API that does some expensive operation (like aggregating user metrics) in a tight loop without any rate limiting. Oops.
A single-source DoS is much easier to handle than a distributed attack, but blocking one IP address isn't always enough. Shared networks can put many legitimate users behind one address, and a single expensive request can do plenty of damage on its own.
Bearly Secure has no application-wide traffic ceiling. FixedWindowRateLimiter already handles fixed-window counters, client keys, headers, and limit responses. Finish createRateLimiter in src/security/rateLimit.ts, then apply it globally.
The in-memory store is deliberate for this local exercise. A multi-instance production deployment needs a shared limiter at the edge or a shared store so every instance sees the same counters.
With Bearly Secure still running, run and submit the CLI tests from the project root.