AWS DDoS Mitigation Best Practices
Learn the best practices for DDoS mitigation on AWS to protect your infrastructure from DDoS attacks and ensure continuous availability.
Table of Contents
Introduction
This article aims to assist users in implementing comprehensive Distributed Denial of Service (DDoS) protection using AWS utilities. It serves as a hands-on implementation manual aligned with the AWS DDoS mitigation strategy. Users are encouraged to read the AWS DDoS mitigation strategy document prior to this guide. The following sections detail the implementation of various AWS components and include specific recommendations based on practical experience.
Key AWS Features Covered
Association of Shield Advanced with relevant resources.
Configuring rules to prevent Direct-to-Origin attacks.
Configuring CloudFront caching policies.
Configuring geo-restriction policies.
Configuring a web-ACL with WAF rules and rate limit policies.
Architecture Designing
The recommended AWS DDoS architecture incorporates a CloudFront distribution that routes traffic to an Application Load Balancer (ALB). The ALB is secured with Security Groups that deny incoming traffic not routed through CloudFront. Both the CloudFront distribution and ALB should be associated with Shield Advanced for enhanced protection .
Shield Advanced Configuration
Steps to Apply Shield Advanced
Subscribe to Shield Advanced through the AWS dashboard.
Add resources to protect.
Configure AWS Shield Response Team (SRT) support.
Activate Proactive Engagement.
Configure Route53 Health checks.
By following these steps, the AWS Shield Response team will assist in mitigating DDoS attacks in case of downtime .

Adding Resources to Protect
To add resources:
Press "Add resources to protect".
-
Choose the regions and resource types to include and load relevant resources that are not yet associated with Shield Advanced .
Configuring AWS SRT Support
Granting access to the SRT optimizes assistance during a DDoS event:
Press "Edit SRT access".
-
Create a new role for SRT to access your account .
Activating Proactive Engagement
Enable the proactive engagement feature to allow SRT to contact the appropriate person in case of an attack .

Configuring Route53 Health Checks
Press "Create health check" in Route53.
-
Fill in details, ensuring to monitor the root (/) by default if no specific URI path is provided .
Monitoring
Once health checks are configured, users can monitor their health status through the AWS dashboard, where alarms will notify users of any issues .

Preventing Direct-to-Origin Attacks
To prevent attacks targeting origin servers:
Configure a Security Groups policy (recommended method).
-
Configure an internal header sent from CloudFront to the ALB .
Security Groups Policy Configuration
-
Create a new security group allowing HTTP and HTTPS traffic from CloudFront PoPs only .
Internal Header Configuration
-
In the ALB, manage rules to add a condition based on the HTTP header .
Caching Configuration
Utilize CloudFront to cache applicable content. Managed caching policies include:
CachingOptimized: Caches mostly static content.
CachingDisabled: Disables caching entirely.
For custom policies, specify TTL values and cache key settings .

Geo-Restriction Configuration
To enforce geo-restrictions, configure settings in the CloudFront distribution to allow or block requests from specific countries .

Creating a Web-ACL
Create a web-ACL in WAF & Shield.
Associate it with the desired resource (CloudFront or ALB).
-
Add rules and configure metrics .
WAF Rules Configuration
Configure custom WAF rules to enhance security, focusing on:
Custom rules.
Managed rules.
-
Rate limit rules .
Rate Limit Rules Configuration
Implement rate limit rules to manage traffic effectively:
Counting per source IP with a “Block” action.
-
Counting total requests to a specific hostname with a “Challenge” action .
Conclusion
Implementing these best practices will enhance your AWS architecture's resilience against DDoS attacks. Ensure you regularly review and update your configuration to adapt to evolving threats.