More Info:
Classic ELB is not recommended to be used. AWS has deprecated it and wants them to move to the alternatives.Risk Level
LowAddress
Security, Operational Maturity, ReliabilityCompliance Standards
CBPTriage and Remediation
Remediation
Using Console
Using Console
Here are the step-by-step instructions to remediate the “No Classic ELB Should Be In Use” misconfiguration in AWS using the AWS console:
- Log in to the AWS Management Console.
- Navigate to the EC2 dashboard.
- Click on the “Load Balancers” option in the left-hand menu.
- Look for any load balancers that are of type “Classic Load Balancer”.
- Select the Classic Load Balancer that you want to remediate.
- Click on the “Actions” button, and select “Delete” from the drop-down menu.
- Confirm that you want to delete the Classic Load Balancer by clicking “Yes, Delete”.
- Repeat this process for any other Classic Load Balancers that you find.
- Open the AWS CLI and navigate to the EC2 dashboard.
- Run the command “aws elb describe-load-balancers”.
- Look for any load balancers that are of type “Classic Load Balancer”.
- Run the command
aws elb delete-load-balancer --load-balancer-name <load-balancer-name>
for each Classic Load Balancer that you want to delete. - Confirm that you want to delete the Classic Load Balancer by typing “yes” when prompted.
Using CLI
Using CLI
To remediate the “No Classic ELB Should Be In Use” misconfiguration in AWS using AWS CLI, you can follow the below steps:
-
List all the classic load balancers in your AWS account using the following command:
- Identify the classic load balancers that are currently in use and need to be replaced with ALB/NLB.
-
Create a new ALB/NLB based on your requirements using the following command:
- Update the DNS records to point to the new ALB/NLB.
-
Update the target groups and listeners of the classic load balancers to the new ALB/NLB using the following commands:
-
Deregister and delete the classic load balancers using the following commands:
- Verify that the new ALB/NLB is functioning properly and all the traffic is being routed to it.
Using Python
Using Python
To remediate the misconfiguration “No Classic ELB Should Be In Use” for AWS using Python, you can use the following steps:
- Import the required AWS SDK and Boto3 library to interact with AWS resources.
- Create a client object for Elastic Load Balancing (ELB) using Boto3.
- Use the describe_load_balancers() method to get a list of all the load balancers in your AWS account.
- Loop through the list of load balancers and check if any of them are Classic load balancers.
- If a Classic ELB is found, use the delete_load_balancer() method to delete it.
- Optionally, you can add a confirmation prompt before deleting the Classic ELB to avoid accidental deletion.
- Run the Python script to identify and delete any Classic ELBs in your AWS account.