More Info:
AWS Elastic Beanstalk CNAME Records Vulnerable To TakeoverRisk Level
MediumAddress
SecurityCompliance Standards
- APRA CPS 234 (Australia)
- BSI C5 (Germany)
- Brazil LGPD
- CCPA / CPRA (California)
- CIS Critical Security Controls v8
- CMMC 2.0
- CSA Cloud Controls Matrix v4
- Cloudanix Best Practice
- DPDPA
- Digital Operational Resilience Act (EU)
- Essential 8
- ISO/IEC 27017
- ISO/IEC 27018
- ISO/IEC 27701
- KSA PDPL
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIS2 Directive
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
To remediate the vulnerability of AWS Elastic Beanstalk CNAME Records in AWS Route53 using the AWS console, follow these steps:
- Sign in to the AWS Management Console.
- Go to the Route53 service.
- In the Route53 dashboard, select the hosted zone where the Elastic Beanstalk CNAME record is present.
- Locate the CNAME record associated with your Elastic Beanstalk environment.
- Click on the CNAME record to select it.
- Choose the “Actions” dropdown menu and click on “Delete record set” to remove the vulnerable CNAME record.
- Confirm the deletion by clicking on “Yes, Delete”.
- Once the CNAME record is deleted, you need to create an Alias record to point to the Elastic Beanstalk environment.
- Click on the “Create record set” button.
- In the “Name” field, enter the subdomain or hostname you want to associate with the Elastic Beanstalk environment.
- Set the “Type” field to “A - IPv4 address”.
- Check the “Alias” checkbox.
- In the “Alias target” field, select your Elastic Beanstalk environment from the dropdown list.
- Click on the “Create” button to create the Alias record.
- Verify that the new Alias record is created and points to the correct Elastic Beanstalk environment.
Using CLI
Using CLI
To remediate the vulnerability of AWS Elastic Beanstalk CNAME Records in AWS Route53 using AWS CLI, follow these steps:
- Open the AWS Command Line Interface (CLI) on your local machine.
- Ensure that you have the AWS CLI installed and configured with the necessary credentials to access your AWS account.
-
Identify the misconfigured CNAME record associated with your Elastic Beanstalk environment. You can do this by listing the hosted zones in Route53 and locating the relevant Elastic Beanstalk environment.
Run the following command to list all the hosted zones in Route53:
Identify the hosted zone corresponding to your Elastic Beanstalk environment.
-
Once you have identified the hosted zone, you need to update the CNAME record to make it more secure. You can achieve this by following these sub-steps:
a. Get the current record set for the CNAME record using the
list-resource-record-setscommand. ReplaceHOSTED_ZONE_IDwith the ID of your hosted zone andCNAME_RECORD_NAMEwith the name of your CNAME record.b. Make a note of theTTL,Name,Type, andResourceRecordsvalues from the command output. c. Delete the existing CNAME record using thechange-resource-record-setscommand. ReplaceHOSTED_ZONE_IDwith the ID of your hosted zone andCNAME_RECORD_NAMEwith the name of your CNAME record.ReplaceEXISTING_VALUEwith the existing value of the CNAME record. d. Create a new CNAME record using thechange-resource-record-setscommand. ReplaceHOSTED_ZONE_IDwith the ID of your hosted zone,CNAME_RECORD_NAMEwith the name of your CNAME record,NEW_VALUEwith the desired value of the CNAME record, andTTLwith the desired TTL value.ReplaceNEW_VALUEwith the new desired value for the CNAME record. -
Verify that the CNAME record has been updated successfully by running the
list-resource-record-setscommand again and ensuring that the new record is present.
Using Python
Using Python
To remediate the vulnerability of AWS Elastic Beanstalk CNAME Records, you can follow the steps below using Python:
-
Install the required Python packages:
-
Import the necessary modules in your Python script:
-
Create a function to retrieve the CNAME records for your Elastic Beanstalk environment:
-
Create a function to delete the CNAME records from AWS Route 53:
-
Call the functions and pass the required parameters to delete the CNAME records:
Using Terraform
Using Terraform
aws_route53_record block from your Terraform configuration (or from the module where it is defined) so Terraform plans to destroy the record.terraform plan should then show:- one
aws_route53_recordmarked with- destroycorresponding to the vulnerable CNAME.

