Skip to main content

More Info:

Your Amazon ElasticSearch (ES) domains should be encrypted with KMS Customer Master Keys (CMKs) instead of AWS managed-keys

Risk Level

High

Address

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
  • DPDPA
  • Digital Operational Resilience Act (EU)
  • HIPAA
  • 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
  • Securities and Exchange Board of India (SEBI) - Cloud Security Adoption Framework
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Remediation

Using Console

Sure, here are the step by step instructions to remediate the Elasticsearch Domain Should Be Encrypted with KMS CMKs on AWS:
  1. Login to your AWS console and navigate to the Elasticsearch service.
  2. Select the Elasticsearch domain that needs to be remediated.
  3. Click on the “Configure” button in the “Security” section.
  4. In the “Encryption” section, select the “KMS” option.
  5. Select the appropriate KMS CMK from the list of available keys. If you don’t have a KMS CMK, you can create one by clicking the “Create a new key” button.
  6. Once you have selected the KMS CMK, click the “Save changes” button to apply the encryption.
  7. Wait for the changes to take effect. This may take a few minutes.
  8. Verify that the Elasticsearch domain is now encrypted with the selected KMS CMK. You can do this by checking the “Encryption” section in the Elasticsearch domain’s configuration.
That’s it! You have successfully remediated the Elasticsearch Domain Should Be Encrypted with KMS CMKs issue on AWS.

To remediate the Elasticsearch Domain misconfiguration in AWS using AWS CLI, you can follow these steps:
  1. Identify the Elasticsearch domain that needs to be encrypted with KMS CMKs.
  2. Create a KMS Customer Master Key (CMK) if you don’t already have one.
  3. Enable AWS Key Management Service (KMS) encryption for the Elasticsearch domain using the following command:
Replace <your-domain-name> with the name of your Elasticsearch domain and <your-KMS-CMK-ARN> with the ARN of the KMS CMK you want to use for encryption.
  1. Verify that the Elasticsearch domain is encrypted with KMS CMKs by running the following command:
If the output is ENABLED, it means that the Elasticsearch domain is encrypted with KMS CMKs.
  1. Repeat the above steps for all Elasticsearch domains that need to be encrypted with KMS CMKs.
Note: Enabling KMS encryption for an Elasticsearch domain may cause a temporary outage as the domain is reconfigured. It is recommended to perform this during a maintenance window.
To remediate the Elasticsearch Domain should be encrypted with KMS CMKs misconfiguration for AWS using python, you can follow the below steps:
  1. First, you need to identify the Elasticsearch Domain that is not encrypted with KMS CMKs. You can use the following AWS CLI command to get the list of Elasticsearch domains:
  1. Once you have identified the Elasticsearch Domain, you need to enable encryption using KMS CMKs. You can use the following AWS CLI command to enable encryption:
Replace <domain-name> with the name of your Elasticsearch Domain and <kms-key-id> with the ID of the KMS CMK that you want to use for encryption.
  1. Verify that the Elasticsearch Domain is encrypted with KMS CMKs. You can use the following AWS CLI command to get the Elasticsearch Domain configuration:
This command will return the Elasticsearch Domain configuration, which should include the EncryptionAtRestOptions parameter with the value Enabled=true and KmsKeyId=<kms-key-id>.
  1. Finally, you can confirm that the Elasticsearch Domain is encrypted with KMS CMKs by checking the AWS KMS console. The KMS CMK that you specified in step 2 should have been used to encrypt the Elasticsearch Domain.
Note: You can use the AWS SDK for Python (Boto3) to automate these steps.
Enabling encryption_at_rest or changing kms_key_id on an existing aws_elasticsearch_domain forces resource replacement in Terraform; this recreates the domain and you must plan for data migration and potential downtime. AWS also makes encryption-at-rest irreversible and, if the domain is already encrypted (e.g., with an AWS-managed key), you cannot change the KMS key without creating a new domain and migrating data.For verification, terraform plan should show creation of aws_kms_key.ES_DOMAIN_KMS_KEY and either:
  • an update to add encryption_at_rest.enabled = true and kms_key_id = ... (if Terraform/provider allows in-place), or
  • a destroy/create cycle (replacement) of aws_elasticsearch_domain.ENCRYPTED_ES_DOMAIN with the new encryption_at_rest block configured.

Additional Reading: