More Info:
Elastic Load Balancer should not send any new requests to the unhealthy instance if an EC2 backend instance fails health checks.Risk Level
InformationalAddress
ReliabilityCompliance 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
- DPDPA
- Digital Operational Resilience Act (EU)
- ISO/IEC 27017
- ISO/IEC 27018
- ISO/IEC 27701
- KSA PDPL
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIST
- NIST CSF
- 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
Sure, here are the step by step instructions to remediate the misconfiguration of ELBs not having Connection Draining enabled in AWS console:
- Open the AWS Management Console and navigate to the EC2 Dashboard.
- From the left-hand menu, click on the “Load Balancers” option.
- Select the ELB that you want to remediate from the list of available load balancers.
- Click on the “Attributes” tab from the bottom panel.
- Under the “Connection Settings” section, click on the “Edit” button.
- In the “Edit Connection Settings” window, check the box next to “Enable Connection Draining”.
- Set the “Connection Draining Timeout” value to the desired number of seconds (e.g., 300 seconds).
- Click on the “Save” button to save the changes.
- Verify that the “Connection Draining” attribute is now enabled for the selected ELB.
Using CLI
Using CLI
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 Note: Replace
<ELB_Name> with the name of your ELB.Step 3: Verify the connection draining is enabled by running the following command:<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.Using Python
Using Python
To remediate the “ELBs Should Have Connection Draining Enabled” misconfiguration in AWS using Python, follow these steps:With these steps, you can remediate the “ELBs Should Have Connection Draining Enabled” misconfiguration in AWS using Python.
- First, import the necessary AWS SDK libraries in your Python script. You will need
boto3andbotocorelibraries.
- Next, create a
boto3client for the Elastic Load Balancing (ELB) service.
- Retrieve a list of all the ELBs in your AWS account using the
describe_load_balancers()method.
- For each ELB in the list, check if Connection Draining is enabled by calling the
describe_load_balancer_attributes()method.
- If Connection Draining is not enabled, use the
modify_load_balancer_attributes()method to enable it.
- Finally, add appropriate logging and error handling to your script.
Using Terraform
Using Terraform
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.
