Your application is under a DDoS attack - users cannot access your services, latency is spiking, and requests are timing out. AWS provides built-in DDoS protection (Shield Standard) and optional advanced protection (Shield Advanced), but you need to act fast to mitigate the impact.
AWS Shield Standard automatically protects against L3/L4 DDoS attacks. Check the Shield dashboard for active events.
# Note: Shield CLI commands require Shield Advanced subscription aws shield list-attacks \ --start-time FromInclusive=<epoch-seconds> \ --end-time ToExclusive=<epoch-seconds>
aws shield describe-attack --attack-id <attack-id>
Check request rates, 5xx errors, latency, and network throughput on your ALB/CloudFront distribution.
# ALB request count aws cloudwatch get-metric-statistics \ --namespace AWS/ApplicationELB \ --metric-name RequestCount \ --dimensions Name=LoadBalancer,Value=<alb-arn-suffix> \ --start-time <1h-ago> --end-time <now> \ --period 60 --statistics Sum
If WAF is enabled, check sampled requests to identify attack signatures (user agents, IPs, request patterns).
aws wafv2 get-sampled-requests \ --web-acl-arn <web-acl-arn> \ --rule-metric-name <rule-name> \ --scope REGIONAL \ --time-window StartTime=<1h-ago>,EndTime=<now> \ --max-items 100
Add a rate-based rule to block IPs exceeding a request threshold (e.g., 2000 requests per 5 minutes).
# Rate-based rules are configured in the WAF console
# or via update-web-acl with a RateBasedStatement
aws wafv2 update-web-acl \
--name <web-acl-name> \
--scope REGIONAL \
--id <web-acl-id> \
--lock-token <token> \
--default-action '{"Allow":{}}' \
--visibility-config '{"SampledRequestsEnabled":true,"CloudWatchMetricsEnabled":true,"MetricName":"web-acl-metric"}' \
--rules file://rate-limit-rule.jsonStart with a higher threshold and lower it gradually to avoid blocking legitimate traffic.
If the attack traffic originates from countries where you have no users, apply geo-blocking via WAF or CloudFront.
aws cloudfront update-distribution \ --id <distribution-id> \ --distribution-config file://geo-restriction-config.json
While mitigation takes effect, scale up ALB capacity, increase Auto Scaling group limits, and enable CloudFront caching.
Create a WAF IP set with the attacker IPs and add a blocking rule.
aws wafv2 create-ip-set \ --name "DDoS-Blocked-IPs" \ --scope REGIONAL \ --ip-address-version IPV4 \ --addresses "1.2.3.4/32" "5.6.7.0/24"
Shield Advanced provides DDoS Response Team (DRT) support, advanced mitigation, and cost protection.
Shield Advanced costs $3,000/month but includes DDoS cost protection - AWS will credit charges from scaling during the attack.
Contact the DRT for expert assistance with active DDoS mitigation.
aws shield create-protection \ --name "Production-ALB" \ --resource-arn <alb-arn>
DDoS attacks often come in waves. Monitor for 24-48 hours after the initial attack subsides.
Based on the attack patterns observed, fine-tune your WAF rules to better protect against similar future attacks.
Once the attack has fully subsided, return Auto Scaling group limits and other temporary changes to normal.
CloudFront absorbs DDoS traffic at the edge, preventing it from reaching your origin. All public-facing apps should use CloudFront.
Have rate-based rules in place before an attack. Reactive rule deployment during an attack is slower.
Document the steps your team took during this incident and create a reusable runbook for the next attack.
When an incident strikes, every minute counts. We help AWS teams prepare, detect, and respond to security incidents with proven expertise.