aws-customer-playbook-framework

Incident Response Playbook: Denial of Service / Distributed Denial of Service (DoS/DDoS)

This document is provided for informational purposes only. It represents the current product offerings and practices from Amazon Web Services (AWS) as of the date of issue of this document, which are subject to change without notice. Customers are responsible for making their own independent assessment of the information in this document and any use of AWS products or services, each of which is provided “as is” without warranty of any kind, whether express or implied. This document does not create any warranties, representations, contractual commitments, conditions, or assurances from AWS, its affiliates, suppliers, or licensors. The responsibilities and liabilities of AWS to its customers are controlled by AWS agreements, and this document is not part of, nor does it modify, any agreement between AWS and its customers.

© 2024 Amazon Web Services, Inc. or its affiliates. All Rights Reserved. This work is licensed under a Creative Commons Attribution 4.0 International License.

This AWS Content is provided subject to the terms of the AWS Customer Agreement available at http://aws.amazon.com/agreement or other written agreement between the Customer and either Amazon Web Services, Inc. or Amazon Web Services EMEA SARL or both.

Points of Contact

Author: Author Name
Approver: Approver Name
Last Date Approved:

Executive Summary

This playbook outlines the process for responding to Denial of Service / Distributed Denial of Service (DoS/DDoS) attacks against AWS hosted resources.

Potential Indicators of Compromise

Potential AWS GuardDuty Findings

Objectives

Throughout the execution of the playbook, focus on the *desired outcomes*, taking notes for enhancement of incident response capabilities.

Determine:

Recover:

Enhance CAF Security Perspective components:

AWS Cloud Adoption Framework Security Perspective

Image


Response Steps

  1. [PREPARATION] Create a Publicly Exposed Asset Inventory
  2. [PREPARATION] Implement training to address DoS/DDoS attacks
  3. [PREPARATION] Develop a communication strategy to escalate and report events
  4. [PREPARATION] Perform documentation reviews to ensure procedures are maintained and current
  5. [DETECTION AND ANALYSIS] Implement AWS Shield
  6. [DETECTION AND ANALYSIS] Utilize the Global Threat Environment Dashboard with AWS Shield
  7. [DETECTION AND ANALYSIS] Consider using AWS Shield Advanced
  8. [PREPARATION] Implement Escalation and Notification Procedures
  9. [DETECTION AND ANALYSIS] Perform Detection and Mitigation
  10. [DETECTION AND ANALYSIS] Identify Top Contributers
  11. [CONTAINMENT] Perform Containment
  12. [ERADICATION] Perform Eradication
  13. [POST-INCIDENT ACTIVITIES] Request a credit in AWS Shield Advanced
  14. [PREPARATION] Additional Preventative Actions: Mitigation Techniques
  15. [PREPARATION] Additional Preventative Actions: Attack Surface Reduction
  16. [PREPARATION] Additional Preventative Actions: Operational Techniques
  17. [PREPARATION] Additional Preventative Actions: Overall Security Posture

***The response steps follow the Incident Response Life Cycle from NIST Special Publication 800-61r2 Computer Security Incident Handling Guide

Image***

Incident Classification & Handling

Incident Handling Process

The incident response process has the following stages:

Preparation

This playbook references and integrates, where possible, with Prowler which is a command line tool that helps you with AWS security assessment, auditing, hardening and incident response.

It follows guidelines of the CIS Amazon Web Services Foundations Benchmark (49 checks) and has more than 100 additional checks including related to GDPR, HIPAA, PCI-DSS, ISO-27001, FFIEC, SOC2 and others.

This tool provides a rapid snapshot of the current state of security within a customer environment. Additionally, AWS Security Hub provides for automated compliance scanning and can integrate with Prowler

Publicly Exposed Asset Inventory

Find resources exposed to the internet: ./prowler -g group17

You can use Security Hub and Firewall Manager to set up centralized monitoring for DDoS events and auto-remediate noncompliant resources

Training

Communication Technology

Documentation Review

  1. Be familiar with the AWS Shield Documentation
  2. If subscribed, follow the Getting started with AWS Shield Advanced guide

Detection

Cloudwatch Metrics to detect DoS/DDoS events

The Recommended Amazon CloudWatch Metrics table lists descriptions of Amazon CloudWatch metrics that are commonly used to detect and react to DDoS attacks.

Global Threat Environment Dashboard

The Global Threat Environment Dashboard provides summary information about all DDoS attacks that have been detected by AWS.

  1. Sign in to the AWS Management Console and open the AWS WAF & Shield console
  2. In the AWS Shield navigation bar, choose Global threat dashboard.
  3. Choose a time period.

AWS Shield Advanced

  1. Sign in to the AWS Management Console and open the AWS WAF & Shield console
  2. In the AWS Shield navigation bar, choose Overview or Events

You have access to a number of CloudWatch metrics that can indicate that your application is being targeted.

  1. You can configure the DDoSDetected metric to tell you if an attack has been detected.
  2. If you want to be alerted based on the attack volume, you can also use the DDoSAttackBitsPerSecond, DDoSAttackPacketsPerSecond, or DDoSAttackRequestsPerSecond metrics.

A full list of available metrics is available within the table in the DDoS Visibility

Escalation Procedures

AWS Shield

AWS Shield Advanced

Analysis

  1. Sign in to the AWS Management Console and open the AWS WAF & Shield console
  2. In the AWS Shield navigation bar, choose Events

Detection and Mitigation

The Detection and mitigation tab displays graphs that show the traffic that AWS Shield evaluated prior to reporting this event and the effect of any mitigation that was placed. It also provides metrics for infrastructure-layer Distributed Denial of Service (DDoS) events for resources in your own Amazon Virtual Private Cloud VPC and AWS Global Accelerator accelerators. Detection and mitigation metrics are not included for Amazon CloudFront or Amazon Route 53 resources.

Top Contributers

The Top contributors tab provides insight into where traffic is coming from during a detected event. You can view the highest volume contributors, sorted by aspects such as protocol, source port, and TCP flags. You can download the information and you can adjust the units used and the number of contributors to display.

Containment

AWS Best Practices for DDoS Resiliency

In this whitepaper, AWS provides you with prescriptive DDoS guidance to improve the resiliency of applications running on AWS. This includes a DDoS-resilient reference architecture that can be used as a guide to help protect application availability. This whitepaper also describes different attack types, such as infrastructure layer attacks and application layer attacks. AWS explains which best practices are most effective to manage each attack type. In addition, the services and features that fit into a DDoS mitigation strategy are outlined and how each one can be used to help protect your applications is explained. Containment procedures assume the use of AWS Web Application Firewalls. If a third party WAF or firewall is being used, customize those procedures here to match your use case.

AWS WAF

  1. Create conditions in AWS WAF that match the unusual behavior.
  2. Add those conditions to one or more AWS WAF rules.
  3. Add those rules to a web ACL and configure the web ACL to count the requests that match the rules.
    • NOTE You should always test your rules first by initially using Count rather than Block. After you’re comfortable that the new rule is identifying the correct requests, you can modify your rule to block those requests.
  4. Monitor those counts to determine if the source of the requests should be blocked. If the volume of requests continues to be unusually high, change your web ACL to block those requests.

Eradication

Not Applicable

Recovery

Requesting a credit in AWS Shield Advanced

If you’re subscribed to AWS Shield Advanced and you experience a DDoS attack that increases utilization of an Shield Advanced protected resource, you can request a credit for charges related to the increased utilization to the extent that it is not mitigated by Shield Advanced.

Additional information can be found in AWS documents at Requesting a credit in AWS Shield Advanced

Preventative Actions

Mitigation Techniques

On AWS, DDoS mitigation capabilities are automatically provided

  1. AWS Shield Standard defends against most common, frequently occurring network and transport layer DDoS attacks that target your web site or applications. This is offered on all AWS services and in every AWS Region at no additional cost.
  2. You can improve your readiness to respond to and mitigate DDoS attacks is by subscribing to AWS Shield Advanced. This optional DDoS mitigation service helps you protect an application hosted on any AWS Region. The service is available globally for Amazon CloudFront and Amazon Route 53. It’s also available in select AWS Regions for Classic Load Balancer (CLB), Application Load Balancer (ALB), and Elastic IP Addresses (EIPs). Using AWS Shield Advanced with EIPs allows you to protect Network Load Balancer (NLBs) or Amazon EC2 instances.
  3. Key considerations to help mitigate volumetric DDoS attacks include ensuring that enough transit capacity and diversity is available, and protecting your AWS resources, like Amazon EC2 instances, against attack traffic
  4. Large DDoS attacks can overwhelm the capacity of a single Amazon EC2 instance, so adding load balancing can help your resiliency.
  5. Amazon CloudFront allows you to cache static content and serve it from AWS edge locations, which can help reduce the load on your origin.
  6. By using AWS WAF, you can configure web access control lists(Web ACLs) on your CloudFront distributions or Application Load Balancers to filter and block requests based on request signatures.

    Attack Surface Reduction

  7. You can specify security groups when you launch an instance, or you can associate the instance with a security group ata later time. All internet traffic to a security group is implicitly denied unless you create an allow rule to permit the traffic.
    • If you are subscribed to AWS Shield Advanced, you can register Elastic IPs (EIPs) as Protected Resources.
  8. If you’re using Amazon CloudFront with an origin that is inside of your VPC, you should use an AWS Lambda function to automatically update your security group rules to allowonly Amazon CloudFront traffic.
  9. Typically, when you must expose an API to the public, there is a risk that the API frontend could be targeted by a DDoS attack. To help reduce the risk, you can use Amazon API Gateway as an entryway to applications running on Amazon EC2, AWS Lambda, or elsewhere.
    • When you use Amazon CloudFront and AWS WAF with Amazon API Gateway, configure the following options:
      1. Configure the cache behavior for your distributions to forward all headers to the API Gateway regional endpoint. By doing this, CloudFront will treat the content as dynamic and skip caching thecontent.
      2. Protect your API Gateway against direct access by configuring the distribution to include the origin custom header x-api-key, by setting theAPI keyvalue in API Gateway.
      3. Protect your backend from excess traffic by configuring standard or burst rate limits for each method in your RESTAPIs.

Operational Techniques

When a key operational metric deviates substantially from the expectedvalue, an attacker may be attempting to target your application’s availability. If you’re familiar with the normal behavior of your application, you can more quickly take action when you detect an anomaly.

  1. If you have architected your application by following the DDoS-resilient reference architecture, common infrastructure layer attacks will be blocked before reaching your application.
  2. If you’re using AWS WAF, you can use CloudWatch to monitor and alarm on increases in requests that you’ve set in WAF to be allowed, counted, or blocked. This allows you to receive a notification if the level of traffic exceeds what your application can handle.

For a description of Amazon CloudWatch metrics that are commonly used to detect and react to DDoS attacks, see the table in the DDoS Visibility

Overall Security Posture

Execute a Self-Service Security Assessment against the environment to further identify other risks and potentially other public exposure not identified throughout this playbook.

Lessons Learned

This is a place to add items specific to your company that do not need "fixing", but are important to know when executing this playbook in tandem with operational and business requirements.

Addressed Backlog Items

Current Backlog Items