Skip to main content

More Info:

EC2 instances registered to your Amazon Elastic Load Balancing (ELB) should be evenly distributed across all Availability Zones (AZs) in order to improve the ELBs configuration reliability.

Risk Level

Low

Address

Reliability, Security

Compliance 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)
  • 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

Using Console

To remediate the misconfiguration of ELBs not being evenly distributed over Availability Zones (AZs) in AWS, you can follow these steps:
  1. Log in to the AWS Management Console and navigate to the EC2 dashboard.
  2. Click on the Load Balancers option in the navigation pane.
  3. Select the ELB that you want to remediate and click on the Edit button.
  4. In the Availability Zones section, select the AZs that are not currently being used by the ELB.
  5. Click on the Add button to add the selected AZs to the ELB.
  6. Once the AZs have been added, click on the Remove button next to any AZs that are currently being used by the ELB but are not evenly distributed.
  7. Click on the Save button to save the changes.
  8. Verify that the ELB is now evenly distributed over all selected AZs by checking the Availability Zones section.
  9. Repeat the above steps for any other ELBs that are not evenly distributed over AZs.
By following these steps, you can remediate the misconfiguration of ELBs not being evenly distributed over AZs in AWS.

To remediate the issue of ELBs not being evenly distributed over AZs in AWS using AWS CLI, follow the below steps:
  1. First, check the availability zones in which the ELB is currently running using the following command:
  1. If the ELB is not evenly distributed over the AZs, then you need to modify the ELB configuration to distribute it evenly over the AZs. You can use the following command to modify the ELB configuration:
This command enables cross-zone load balancing for the ELB, which ensures that the traffic is evenly distributed across all the AZs.
  1. Once the modification is done, you can verify that the ELB is now evenly distributed over all AZs by running the command in step 1 again.
By following these steps, you can remediate the issue of ELBs not being evenly distributed over AZs in AWS using AWS CLI.
To remediate this misconfiguration in AWS, you can use the following steps using Python:
  1. Get a list of all the Elastic Load Balancers (ELBs) in your AWS account using the boto3 library.
  1. For each ELB, get the list of Availability Zones (AZs) it is currently deployed in.
  1. Check if the number of AZs the ELB is deployed in is less than the total number of AZs available in the region.
  1. If the number of AZs is less than the total number of AZs available in the region, evenly distribute the ELB across all the AZs.
  1. Once you have updated all the ELBs, verify that they are now evenly distributed across all the AZs in the region.
Note: Make sure you have the necessary permissions to modify the ELB attributes.
Terraform cannot automatically “evenly distribute” instances across AZs; that part matches the CLI warning and must be done by provisioning/registering instances in under‑represented AZs via the console or CLI.This change does not force replacement of the ELB; terraform plan should show an in‑place update like:
  • ~ aws_elb.THIS_LOAD_BALANCER
    • cross_zone_load_balancing.enabled: "false" => "true"

Additional Reading: