Description
Encryption at rest protects the domain’s indexes and automated snapshots. Protect the S3 bucket used for manual snapshots, logs exported to CloudWatch and data in transit separately.
Potential impact
Someone who obtains unencrypted stored data or backups could read sensitive documents and operational logs.
Remediation
Set enabled = true in encrypt_at_rest. If you need a customer managed key, set kms_key_id to its approved ARN. New Elasticsearch domains need version 5.1 or later on a supported instance type. Enabling encryption in place needs 6.7 or later. With UltraWarm or cold storage, move indexes you need to keep to hot storage and disable those tiers first. If Terraform plans replacement, retain the source and recovery options and migrate before switching. Verify the applied encryption and key permissions, snapshot recovery and client connectivity.
Examples
Neither excerpt supplies a key, so the second uses the default service key. Supply a supported var.elasticsearch_version and configure instances, storage, access policies and networking separately.
Before
resource "aws_elasticsearch_domain" "search_domain" {
domain_name = "example"
elasticsearch_version = var.elasticsearch_version
encrypt_at_rest {
enabled = false
}
}
After
resource "aws_elasticsearch_domain" "search_domain" {
domain_name = "example"
elasticsearch_version = var.elasticsearch_version
encrypt_at_rest {
enabled = true
}
}