Skip to main content

More Info:

Ensure that your AWS ElastiCache Redis clusters are encrypted in order to meet security and compliance requirements (keep Personally Identifiable Information safe). Data encryption helps prevent unauthorized users from reading sensitive data available on your Redis clusters and their associated cache storage systems. This includes data saved to persistent media, known as data at-rest, and data that can be intercepted as it travels through the network, between clients and cache servers, known as data in-transit.

Risk Level

High

Address

Security

Compliance Standards

HIPAA,GDPR,NIST,SOC2,NISTCSF,PICDSS

Remediation

How to encrypt elastic cache at rest and in transit.

Using AWS Console

Encrypting ElastiCache at Rest:
  1. Log in to the AWS Management Console using your AWS account credentials.
  2. Navigate to the ElastiCache service by selecting “ElastiCache” from the services menu.
  3. In the ElastiCache dashboard, select the cache cluster for which you want to enable encryption. (In the Cloudanix Console, navigate to “Misconfig” page and look for Affected Assets for “Elasticcache should be encrypted at rest and in transit” Policy.)
  4. Click on the “Actions” button and select “Modify” from the dropdown menu.
  5. In the Modify cluster settings page, scroll down to the “Encryption at Rest” section.
  6. Choose the encryption option that suits your requirements. You have two options:
    • AWS Managed Keys (AWS KMS): Select “Enable” and choose the appropriate AWS Key Management Service (KMS) key from the dropdown menu.
    • Customer Managed Keys (CMKs): Select “Enable” and provide the ARN of the customer managed key you want to use.
  7. Review the other configuration settings as needed and click on the “Modify” button.
  8. AWS will apply the encryption changes to the ElastiCache cluster, which may take a few minutes to complete.
  9. Once the encryption is successfully applied, your ElastiCache data will be encrypted at rest.
Encrypting ElastiCache in Transit:
  1. Ensure that your ElastiCache cluster is deployed in a Virtual Private Cloud (VPC). If not, create a VPC and deploy your ElastiCache cluster within it.
  2. In the AWS Management Console, navigate to the VPC service by selecting “VPC” from the services menu.
  3. In the VPC dashboard, select “Security Groups” from the left navigation pane.
  4. Locate the security group associated with your ElastiCache cluster.
  5. Click on the security group, and in the “Inbound Rules” tab, add a new rule to allow incoming traffic on the desired port(s) for ElastiCache (e.g., port 6379 for Redis).
  6. Ensure that the source IP or CIDR range specified in the rule is limited to the trusted clients or applications that need access to the ElastiCache cluster.
  7. Click on “Save Rules” to apply the security group changes.
  8. By allowing access only from trusted sources, you ensure that the traffic to and from your ElastiCache cluster is encrypted in transit.

Triage and Remediation

Remediation

Using Console

Below are step‑by‑step console instructions to enable encryption at rest and encryption in transit for Amazon OpenSearch Service / Amazon Elasticsearch Service (the managed service often called “AWS Elasticsearch”).
Important: Some encryption options cannot be changed on an existing domain. If the options are grayed out, you must create a new domain with encryption enabled and migrate data.

1. Check Current Encryption Settings

  1. Sign in to the AWS Management Console.
  2. Go to Amazon OpenSearch Service (or “Amazon Elasticsearch Service” if you’re on an older console).
  3. In the left pane, choose Domains.
  4. Click your domain name.
  5. On the domain’s detail page:
    • Look at Security or Encryption sections:
      • Encryption at rest: check if it’s Enabled.
      • Node-to-node encryption: check if it’s Enabled.
      • Domain endpoint: verify if it’s using HTTPS only.
If any of these are disabled and you cannot edit them, proceed to create a new domain.

2.1 Create a New Domain with Encryption

  1. In the OpenSearch Service console, click Create domain.
  2. Engine version: choose your required OpenSearch/Elasticsearch version.
  3. Domain name: enter a unique name (e.g., my-secure-domain).
  4. Continue through:
    • Network:
      • Choose VPC access if possible (recommended).
    • Data nodes: choose instance type and count.

2.2 Enable Encryption at Rest

  1. Scroll to the Data protection or Encryption section.
  2. Check Enable encryption at rest.
  3. Choose a KMS key:
    • Use the AWS managed key or
    • Choose a customer-managed CMK in KMS.
  4. (Optional) Enable Auto-Tune and other performance settings as needed.

2.3 Enable Node-to-Node Encryption (In-Transit Within the Cluster)

  1. In the same security/encryption section, check Enable node-to-node encryption.
    • This encrypts traffic between cluster nodes.

2.4 Enforce HTTPS for Client Connections (In Transit from Clients)

  1. In the Domain endpoint or Network/“Security” section:
    • Ensure Require HTTPS is selected (or equivalent option that disallows HTTP).
    • If there’s an Endpoint security or TLS policy field, select a modern TLS policy (e.g., Policy-Min-TLS-1-2-2019-07).
  2. Configure access policy:
    • Use fine-grained access control + IAM, or
    • Restrict by VPC and security groups, or
    • If using a public endpoint, restrict by IAM and/or source IP.
  3. Click Next, review all settings, then click Create.
AWS will now create the secure domain (this can take several minutes).

3. Migrate Data from Old Domain to New Secure Domain

  1. Once the new domain is Active, note its HTTPS endpoint.
  2. From an EC2 instance, container, or your workstation (with network access to both domains), use:
    • reindex from remote (if supported by your version), or
    • A tool such as Logstash, Elasticsearch/OpenSearch reindex APIs, or a custom script:
      • Read from http(s)://old-domain-endpoint
      • Write to https://new-domain-endpoint
  3. Update:
    • Application configuration
    • Lambda functions
    • Log shippers (Filebeat, Fluentd, CloudWatch Logs subscription filters, etc.) to use the new domain’s HTTPS endpoint.
  4. Validate:
    • Index and document counts between old and new domains.
    • Application functionality and performance.
  5. When fully migrated and tested, delete the old (unencrypted) domain from the console.

4. If You Must Modify an Existing Domain

  1. In the OpenSearch Service console, open your domain.
  2. Click Edit (or Edit domain).
  3. Look for:
    • Encryption at rest: Try to select Enable encryption at rest and choose a KMS key.
    • Node-to-node encryption: Try to select Enable.
    • Require HTTPS: Ensure it is turned on.
  4. If any are grayed out or locked, AWS does not allow changing them in-place for that domain → you must use the new domain + migration approach above.
  5. Save/Apply changes and wait for the domain to finish updating.

5. Verify Encryption

  1. On the domain’s details page:
    • Encryption at rest: shows Enabled with the KMS key.
    • Node-to-node encryption: shows Enabled.
    • Endpoint: begins with https:// and Only HTTPS allowed.
  2. From a client:
    • Ensure all connections use the HTTPS endpoint.
    • Confirm TLS negotiation (e.g., using curl -v https://your-domain-endpoint).

If you tell me whether you’re on the OpenSearch or legacy Elasticsearch console and whether the domain is in a VPC or public, I can tailor the exact console menu/field names for your environment.
For Amazon Elasticsearch / OpenSearch, encryption at rest and in-transit cannot be turned on for an existing domain. You must create a new domain with encryption enabled, migrate data, then cut over.Below are concise, CLI-focused steps.

1. Capture current domain config (for reference)

Use this JSON to copy any important settings (instance type, count, EBS size, access policy, etc.) into the new domain command.

2. Create a new domain with encryption enabled

Key options:
  • --encryption-at-rest-options Enabled=true
  • --node-to-node-encryption-options Enabled=true
  • --domain-endpoint-options EnforceHTTPS=true,TLSecurityPolicy=Policy-Min-TLS-1-2-2019-07
Example (adjust values as needed):
To use a specific KMS key for encryption at rest:
Wait for the domain to be active:
Repeat until it returns false.

3. Verify encryption settings

Confirm:
  • EncryptionAtRestOptions.Enabled = true
  • NodeToNodeEncryptionOptions.Enabled = true
  • DomainEndpointOptions.EnforceHTTPS = true

4. Migrate data from old to new domain

Use reindex-from-remote via the Elasticsearch/OpenSearch API (not CLI) from the new domain, for each index:
Repeat for all indices (you can keep same index names if desired).

5. Update clients to use HTTPS endpoint of new domain

From CLI, get the endpoint:
Update all applications, Lambdas, etc. to use:
  • The HTTPS endpoint of NEW_DOMAIN_NAME
  • TLS 1.2–compatible clients

6. Decommission old domain

Once you have:
  • Verified data in the new domain
  • Switched all traffic to the new domain
  • Observed stable operations
Delete old domain:

If instead you actually meant ElastiCache, say so and I’ll give the corresponding aws elasticache CLI steps.
You’re mixing two different services in the question, so I’ll answer for what you explicitly asked: AWS Elasticsearch / OpenSearch Service (not ElastiCache).For Amazon Elasticsearch / OpenSearch, “encrypted at rest and in transit” means:
  • At rest: EncryptAtRestOptions.Enabled = True
  • Node-to-node: NodeToNodeEncryptionOptions.Enabled = True
  • Client-to-domain (in transit): HTTPS-only endpoint (DomainEndpointOptions.EnforceHTTPS = True)
You cannot turn on at-rest encryption on an existing domain where it was disabled at creation; you must create a new domain with encryption and migrate your data.Below are step‑by‑step instructions and Python (boto3) examples.

1. Prerequisites

  1. Install boto3 and configure AWS credentials:
  1. Use Python 3 and import boto3:

2. Check current domain encryption settings

If Encrypt at rest or Node-to-node is False or missing, you must create a new domain.

3.1. Decide on new domain name and region

3.2. Read configuration from existing domain

3.3. Create new domain with encryption enabled

Wait for the domain to become active:

4. Migrate data from old (unencrypted) to new (encrypted) domain

Use a migration method like:
  • reindex from remote (if supported by your engine version), or
  • Logstash, or
  • a custom Python script using elasticsearch/opensearch-py client.
Example using reindex from remote (conceptual, done via HTTP, not boto3):
  1. Get endpoints:
  1. Use an HTTP client (e.g., requests) or opensearch-py to call _reindex from target domain:
Repeat for all indices. Validate data, aliases, index settings, etc.

5. Switch traffic and delete old domain

  1. Update any clients, apps, or DNS records to use the new domain endpoint (https://<new-endpoint>).
  2. Test thoroughly.
  3. Delete the old domain once you’re sure:

6. If encryption is already enabled but HTTPS is not

You can update the endpoint options in-place:
This enforces in-transit encryption for clients; node-to-node and at-rest must have been enabled at creation time.

Summary

  • Use create_elasticsearch_domain with:
    • EncryptionAtRestOptions.Enabled = True
    • NodeToNodeEncryptionOptions.Enabled = True
    • DomainEndpointOptions.EnforceHTTPS = True
  • If encryption wasn’t enabled originally, create a new domain and migrate data.
  • Manage all of this via boto3 as shown above.
Changing encrypt_at_rest.enabled or node_to_node_encryption.enabled from false to true forces replacement of the OpenSearch/Elasticsearch domain, which can cause downtime unless you manage cutover (e.g., with blue/green or DNS).To verify, terraform plan should show encrypt_at_rest.enabled = true, node_to_node_encryption.enabled = true, and domain_endpoint_options.enforce_https = true, with a resource replacement if you are enabling these on an existing unencrypted domain.