More Info:
Determine if the Elasticsearch (ES) instances provisioned in your AWS account have the desired instance type established by your organization based on the workload deployed.Risk Level
LowAddress
Cost Optimisation, SecurityCompliance Standards
CBPTriage and Remediation
- Remediation
Remediation
Using Console
Using Console
Sure, here are the step by step instructions to remediate the Elasticsearch misconfiguration “Elasticsearch Should Use The Desired Instance Type” for AWS using the AWS console:
- Open the AWS Management Console and navigate to the Elasticsearch Service.
- Click on the Elasticsearch domain that you want to remediate.
- In the navigation pane, click on the “Elasticsearch Version” link.
- In the “Elasticsearch Version” page, click on the “Update” button.
- In the “Update Elasticsearch Version” page, select the desired Elasticsearch version and instance type.
- Click on the “Next” button.
- In the “Instance Configuration” page, select the number of instances and the instance type.
- Click on the “Next” button.
- In the “Review” page, review the changes and click on the “Submit” button to apply the changes.
Using CLI
Using CLI
To remediate the Elasticsearch instance type misconfiguration in AWS using AWS CLI, follow these steps:
-
Open the AWS CLI and check the current Elasticsearch instance type by running the following command:
- The output will show the current Elasticsearch instance type. Note down the instance type and determine the desired instance type.
-
Modify the Elasticsearch instance type by running the following command:
Replace
<your-domain-name>with the name of your Elasticsearch domain and<desired-instance-type>with the desired instance type. -
Wait for the Elasticsearch domain to update, which may take several minutes. You can check the status of the update by running the following command:
- Verify that the Elasticsearch instance type has been updated to the desired instance type.
Using Python
Using Python
To remediate the Elasticsearch misconfiguration “Elasticsearch Should Use The Desired Instance Type” in AWS using Python, you can follow these steps:This code will loop through each Elasticsearch domain in your AWS account, check its current instance type, and update it to the desired instance type if it is not already set to that value. Note that you will need to have the appropriate AWS credentials configured to run this code.
- Define the desired instance type for Elasticsearch in your AWS account.
- Use the AWS SDK for Python (Boto3) to update the Elasticsearch domain’s instance type to the desired instance type.

