Skip to main content

More Info:

This rule checks if your Amazon EC2 Auto Scaling groups that are associated with a Classic Load Balancer use Elastic Load Balancing health checks. The rule is NON_COMPLIANT if the Amazon EC2 Auto Scaling groups are not using Elastic Load Balancing health checks.

Risk Level

Medium

Address

Configuration

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
  • Reserve Bank of India (RBI) Master Direction – Information Technology Framework
  • 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 Autoscaling Groups Health Checks not being checked in AWS EC2 using the AWS console, follow these step-by-step instructions:
  1. Login to AWS Console: Go to the AWS Management Console (https://aws.amazon.com/console/) and login to your account.
  2. Navigate to EC2 Dashboard: Click on the “Services” dropdown menu at the top left corner and select “EC2” under the Compute section.
  3. Select Autoscaling Groups: In the EC2 Dashboard, under the “Auto Scaling” section in the left-hand menu, click on “Auto Scaling Groups”.
  4. Select the Autoscaling Group: Click on the Autoscaling Group that you want to remediate the health check misconfiguration for.
  5. Edit Autoscaling Group Settings: In the Autoscaling Group details page, click on the “Edit” button to modify the group settings.
  6. Update Health Check Configuration: Scroll down to the “Health check type” section and ensure that the “Health check type” is set to “EC2” or “ELB” based on your requirements.
  7. Configure Health Check Parameters: Configure the health check parameters such as “Grace period” and “Health check grace period” based on your application’s requirements.
  8. Save Changes: After updating the health check configuration, click on the “Update” or “Save” button to apply the changes to the Autoscaling Group.
  9. Verify Configuration: Once the changes are saved, verify the health check configuration by checking the status of the Autoscaling Group and monitoring the health of the instances.
By following these steps, you can successfully remediate the misconfiguration of Autoscaling Groups Health Checks not being checked in AWS EC2 using the AWS console.

To remediate the misconfiguration of Autoscaling Groups Health Checks not being checked for AWS EC2 using AWS CLI, follow these steps:
  1. List all the autoscaling groups in your AWS account to identify the group that needs to be updated:
  1. Identify the Autoscaling Group that needs to have health checks enabled and note down the name of the Autoscaling Group.
  2. Update the Autoscaling Group to enable health checks by running the following command, replacing <autoscaling-group-name> with the actual name of the Autoscaling Group:
In this command, we are setting the health check type to EC2 and the health check grace period to 300 seconds. You can adjust the health check type and grace period as needed.
  1. Verify that the health checks have been successfully enabled for the Autoscaling Group by describing the Autoscaling Group again:
By following these steps, you can remediate the misconfiguration of Autoscaling Groups Health Checks not being checked for AWS EC2 using AWS CLI.
To remediate the misconfiguration of Autoscaling Groups Health Checks not being checked in AWS EC2 using Python, you can follow these steps:
  1. Import Boto3 Library: Boto3 is the AWS SDK for Python, which allows Python developers to write software that makes use of services like Amazon S3 and Amazon EC2. You need to have Boto3 installed in your Python environment.
  1. Initialize Boto3 EC2 Client: To interact with the EC2 service, you need to create a Boto3 EC2 client.
  1. Get Autoscaling Groups: Use the describe_auto_scaling_groups method to get a list of all Autoscaling Groups in your AWS account.
  1. Enable Health Checks: For each Autoscaling Group, check if the health check is enabled. If not, update the Autoscaling Group to enable health checks.
  1. Complete Python Script:
  1. Run the Python Script: Save the script in a file (e.g., remediate_health_checks.py) and run it using Python. Make sure your AWS credentials are properly configured on your system.
By following these steps, you can remediate the misconfiguration of Autoscaling Groups Health Checks not being checked in AWS EC2 using Python.
This change updates the Auto Scaling group to use ELB health checks; instances failing the Classic Load Balancer’s health check will be marked unhealthy and replaced by the ASG. It is an in-place update and does not force replacement of the Auto Scaling group.To verify, terraform plan should show a single in-place update (~) on the aws_autoscaling_group with health_check_type changing from "EC2" (or omitted) to "ELB" (and any new health_check_grace_period value, if added).

Additional Reading: