Skip to main content

Triage and Remediation

Remediation

Using Console

Sure, here are the step by step instructions to remediate the misconfiguration of ELBs not having Connection Draining enabled in AWS console:
  1. Open the AWS Management Console and navigate to the EC2 Dashboard.
  2. From the left-hand menu, click on the “Load Balancers” option.
  3. Select the ELB that you want to remediate from the list of available load balancers.
  4. Click on the “Attributes” tab from the bottom panel.
  5. Under the “Connection Settings” section, click on the “Edit” button.
  6. In the “Edit Connection Settings” window, check the box next to “Enable Connection Draining”.
  7. Set the “Connection Draining Timeout” value to the desired number of seconds (e.g., 300 seconds).
  8. Click on the “Save” button to save the changes.
  9. Verify that the “Connection Draining” attribute is now enabled for the selected ELB.
That’s it! You have successfully remediated the misconfiguration of ELBs not having Connection Draining enabled in AWS.

To remediate the misconfiguration “ELBs Should Have Connection Draining Enabled” in AWS using AWS CLI, please follow the below steps:Step 1: Open the AWS CLI on your local machine.Step 2: Run the following command to enable connection draining for an existing ELB:
Note: Replace <ELB_Name> with the name of your ELB.Step 3: Verify the connection draining is enabled by running the following command:
Note: Replace <ELB_Name> with the name of your ELB.If the output of the above command shows “Enabled”: true, then the connection draining is enabled for your ELB.That’s it! You have successfully remediated the misconfiguration “ELBs Should Have Connection Draining Enabled” in AWS using AWS CLI.
To remediate the “ELBs Should Have Connection Draining Enabled” misconfiguration in AWS using Python, follow these steps:
  1. First, import the necessary AWS SDK libraries in your Python script. You will need boto3 and botocore libraries.
  1. Next, create a boto3 client for the Elastic Load Balancing (ELB) service.
  1. Retrieve a list of all the ELBs in your AWS account using the describe_load_balancers() method.
  1. For each ELB in the list, check if Connection Draining is enabled by calling the describe_load_balancer_attributes() method.
  1. If Connection Draining is not enabled, use the modify_load_balancer_attributes() method to enable it.
  1. Finally, add appropriate logging and error handling to your script.
With these steps, you can remediate the “ELBs Should Have Connection Draining Enabled” misconfiguration in AWS using Python.
This change is an in-place update for a Classic Load Balancer and does not force replacement, but it does modify live traffic handling; review the timeout value (in seconds) for your application before applying.To verify, terraform plan should show an in-place update on aws_elb.CLASSIC_ELB_NAME with connection_draining changing to true (if it was false or unset) and connection_draining_timeout set to 300.