implementing-ddos-mitigation-with-cloudflare
What it does
This tool helps protect your website from attacks that try to overload it and take it offline. It configures automatic and custom defenses using Cloudflare.
When to use it
- βYour website is receiving a lot of unexpected traffic.
- βYou want to prevent attacks that make your site slow or unavailable.
- βYou need to comply with security regulations for your business.
Skill link
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-ddos-mitigation-with-cloudflare/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βSet up DDoS attack protection for my website using Cloudflare.β
5 new skills a week. 1 minute to read.
How it works
The tool connects to Cloudflare and adjusts security settings. It activates automatic protections against different types of attacks and allows creating specific rules to block malicious traffic.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Implementing DDoS Mitigation with Cloudflare
Overview
Cloudflare provides multi-layer DDoS protection across its global network of over 300 data centers with 477+ Tbps of capacity. The platform protects against L3/4 volumetric attacks (SYN floods, UDP amplification, DNS reflection), protocol attacks (Ping of Death, Smurf), and L7 application-layer attacks (HTTP floods, Slowloris, cache-busting). Cloudflare's autonomous detection systems identify and mitigate attacks within approximately 3 seconds using traffic profiling, machine learning, and adaptive rulesets. This skill covers configuring Cloudflare's DDoS protection stack including managed rulesets, WAF rules, rate limiting, Bot Management, and origin server hardening.
When to Use
- When deploying or configuring implementing ddos mitigation with cloudflare capabilities in your environment
- When establishing security controls aligned to compliance requirements
- When building or improving security architecture for this domain
- When conducting security assessments that require this implementation
Prerequisites
- Cloudflare account (Pro plan minimum for WAF, Enterprise for Advanced DDoS)
- Domain with DNS delegated to Cloudflare nameservers
- Origin server IP address(es)
- Understanding of normal traffic patterns and peak volumes
- Cloudflare API token for automation
Core Concepts
DDoS Attack Categories
| Layer | Attack Type | Examples | Cloudflare Protection |
|---|---|---|---|
| L3/4 | Volumetric | SYN flood, UDP flood, DNS amplification | Network-layer DDoS managed rules |
| L3/4 | Protocol | Ping of Death, Smurf, IP fragmentation | Advanced TCP Protection |
| L7 | Application | HTTP flood, Slowloris, cache busting | HTTP DDoS managed rules, WAF, Rate Limiting |
| DNS | DNS-specific | DNS query flood, NXDOMAIN attack | Advanced DNS Protection |
Cloudflare Protection Stack
Internet Traffic
β
βΌ
βββββββββββββββββββββββββββ
β Cloudflare Edge (PoP) β
β βββββββββββββββββββββ β
β β L3/4 DDoS Mgd Rulesβ β β Volumetric/Protocol mitigation
β βββββββββββββββββββββ β
β βββββββββββββββββββββ β
β β IP Access Rules β β β Country/ASN/IP blocks
β βββββββββββββββββββββ β
β βββββββββββββββββββββ β
β β Bot Management β β β Bot score, JS challenge
β βββββββββββββββββββββ β
β βββββββββββββββββββββ β
β β WAF Managed Rules β β β OWASP, Cloudflare, Custom
β βββββββββββββββββββββ β
β βββββββββββββββββββββ β
β β Rate Limiting β β β Request rate enforcement
β βββββββββββββββββββββ β
β βββββββββββββββββββββ β
β β HTTP DDoS Mgd Rulesβ β β L7 flood detection
β βββββββββββββββββββββ β
βββββββββββββββββββββββββββ
β
βΌ
Origin Server
Workflow
Step 1: Onboard Domain to Cloudflare
# Add domain via API
curl -X POST "https://api.cloudflare.com/client/v4/zones" \
-H "Authorization: Bearer $CF_API_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"name": "example.com",
"type": "full",
"plan": {"id": "enterprise"}
}'
# Update DNS records (proxy enabled for DDoS protection)
curl -X POST "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records" \
-H "Authorization: Bearer $CF_API_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"type": "A",
"name": "example.com",
"content": "203.0.113.50",
"proxied": true,
"ttl": 1
}'
Step 2: Configure DDoS Managed Rulesets
HTTP DDoS Attack Protection override:
# List HTTP DDoS managed ruleset
curl -X GET "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/rulesets/phases/ddos_l7/entrypoint" \
-H "Authorization: Bearer $CF_API_TOKEN"
# Override HTTP DDoS sensitivity and action
curl -X PUT "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/rulesets/phases/ddos_l7/entrypoint" \
-H "Authorization: Bearer $CF_API_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"rules": [{
"action": "execute",
"action_parameters": {
"id": "4d21379b4f9f4bb088e0729962c8b3cf",
"overrides": {
"rules": [{
"id": "fdfdac75430c4c47a422bdc024aab531",
"sensitivity_level": "medium",
"action": "block"
}],
"sensitivity_level": "high"
}
},
"expression": "true"
}]
}'
Network-layer DDoS Protection override:
β¦
FAQ
What are DDoS attacks?
These are attacks that send a huge volume of traffic to a website, aiming to overwhelm it and make it inaccessible to legitimate users.
What is Cloudflare?
It's a service that acts as an intermediary between visitors and your website, offering security, performance, and reliability.
Do I need technical knowledge to use this?
The tool simplifies the process, but having a Cloudflare account and knowing your server's IP address is helpful.
Details
Original description by the author
Configure Cloudflare DDoS protection with managed rulesets, rate limiting, WAF rules, Bot Management, and origin protection to mitigate volumetric, protocol, and application-layer attacks.
Popularity
- GitHub stars
- 35k
- Ranking position
- #8023
- License
- Apache-2.0
- Updated
- 8/31/2026
Comments
- β¦
More skills from this repository
abusing-dpapi-for-credential-access
35kGives your AI agent ready-made instructions for a specific task, so it does it better and faster.
abusing-shadow-credentials-for-privesc
35kTeaches your AI agent to write clear, well-structured text.
achieving-cmmc-level-2-compliance
35kHelps your agent prepare an environment for CMMC Level 2 compliance. It implements security requirements and manages necessary documentation.
acquiring-disk-image-with-dd-and-dcfldd
35kHelps your agent create exact copies of hard drives. This is useful for ensuring no information is lost or altered during investigations.
Similar skills
openclaw-update
394kHelps your agent update an existing OpenClaw Gateway, choosing the update method that fits how it was installed and keeping your session working.
diagnose-gateway
394kHelps your agent find out why your OpenClaw Gateway is failing by checking settings, channels, and ports without changing anything.
crabbox-apps
394kHelps your agent open and run an app on a temporary cloud machine, then show its view in your chat side panel.