Triage and Remediation
Remediation
Using Console
Using Console
To remediate the misconfiguration of enabling Encryption At Rest for AWS OpenSearch Service Domains, follow these step-by-step instructions using the AWS Management Console:
- Login to AWS Console: Go to the AWS Management Console (https://aws.amazon.com/) and log in to your account.
- Navigate to Amazon OpenSearch Service: In the AWS Management Console, search for “OpenSearch Service” in the search bar at the top of the page and click on the service.
- Select the OpenSearch Domain: From the list of OpenSearch domains, select the domain for which you want to enable Encryption At Rest.
- Click on the Domain Name: Click on the name of the selected OpenSearch domain to open the domain details page.
- Navigate to Security: In the domain details page, navigate to the “Security” section in the left-hand menu.
- Enable Encryption At Rest: In the “Encryption At Rest” section, click on the “Edit” button to modify the encryption settings.
- Enable Encryption: In the encryption settings, select the option to enable Encryption At Rest. You can choose to use the AWS managed KMS key or provide your custom KMS key for encryption.
- Save Changes: After enabling Encryption At Rest and configuring the encryption settings as per your requirements, click on the “Save changes” button to apply the changes.
- Monitor Encryption Status: Once the changes are saved, monitor the status of Encryption At Rest for the OpenSearch domain to ensure that it is successfully enabled.
Using CLI
Using CLI
To enable encryption at rest for an Amazon OpenSearch Service domain in AWS using the AWS CLI, follow these steps:
-
Identify the OpenSearch Service domain: First, you need to identify the OpenSearch Service domain for which you want to enable encryption at rest. You can list all the domains using the following AWS CLI command:
-
Enable encryption at rest: Once you have identified the domain, you can enable encryption at rest by updating the domain configuration. Use the following AWS CLI command to update the domain configuration and enable encryption at rest:
Replace
<your-domain-name>
with the actual name of your OpenSearch Service domain. -
Monitor the domain: After enabling encryption at rest, monitor the domain to ensure that the configuration change is successfully applied. You can check the status of the domain using the following AWS CLI command:
Replace
<your-domain-name>
with the actual name of your OpenSearch Service domain. -
Verify encryption at rest: Finally, verify that encryption at rest is enabled for the OpenSearch Service domain by checking the domain configuration. You can use the following AWS CLI command to describe the domain configuration:
Replace
<your-domain-name>
with the actual name of your OpenSearch Service domain.
Using Python
Using Python
To remediate the misconfiguration of enabling Encryption At Rest for AWS OpenSearch Service domains using Python, you can use the AWS SDK for Python (Boto3) to update the domain configuration. Here are the step-by-step instructions to enable Encryption At Rest for an AWS OpenSearch Service domain:After running the script, Encryption At Rest should be enabled for the specified AWS OpenSearch Service domain.
- Install Boto3: If you haven’t already installed the Boto3 library, you can do so using pip:
-
Configure AWS Credentials: Make sure you have your AWS credentials configured either by setting environment variables or using AWS CLI
aws configure
. -
Write Python script: Create a Python script with the following code to enable Encryption At Rest for the OpenSearch Service domain. Replace
your-domain-name
with the actual domain name of your OpenSearch Service domain:
- Run the script: Execute the Python script to enable Encryption At Rest for the specified OpenSearch Service domain: