Skip to main content

Production incident · Diagnosis and remediation

DDoS incident caused by an exposed origin

Production incident where the protection layer could be bypassed

A client’s production service came under a DDoS attack. The domain sat behind Cloudflare, yet the origin server still accepted direct connections from the internet.

Problem

The application ran in a Docker container with published ports and no reverse proxy in front of it. Because Docker inserts its own iptables rules for published ports, UFW wasn’t filtering them. Anyone who knew the origin IP could bypass Cloudflare altogether.

Outcome

Closing direct access forced all traffic back through Cloudflare so the edge rules could actually take effect, restoring stable access for legitimate users.

Decisions and implementation

  • Tightened Cloudflare’s WAF and rate limits first. Traffic hitting the application didn’t drop, and Cloudflare’s analytics showed nothing close to the flood in the container logs. That mismatch pointed straight to traffic bypassing the edge.
  • Checked the server in Censys and Shodan, which confirmed the origin IP was publicly exposed, and matched Cloudflare metrics against the origin logs.
  • Rotated and isolated the origin IP and shut down the direct paths to the host.
  • Once direct access was closed, tuned the WAF and rate limits to filter the attack without blocking regular visitors, including rules from Sefinek’s community-maintained Cloudflare-WAF-Expressions set.
  • Added application-level caching for database queries, views, and routes so each request cost less CPU and DB time.

Stack

  • Cloudflare
  • WAF
  • Rate limiting
  • Docker
  • Linux
  • Origin isolation
  • Application caching
  • Log analysis

Related notes

Technical notes written from this project:

Broader work history: experience.

Dealing with a similar problem in your own system? Reach out via the contact page.

Related service: Application and server security

All case studiesNext case study: Device provisioning platform