Project: KICS (Provisioning / Security & Compliance)
File: 86a248ab-0e01-4564-a82a-878303e253bb.md

title: ElasticSearch Not Encrypted At Rest hide: toc: true navigation: true <style> .highlight .hll { background-color: #ff171742; } .md-content { max-width: 1100px; margin: 0 auto; } </style> Query id: 86a248ab-0e01-4564-a82a-878303e253bb Query name: ElasticSearch Not Encrypted At Rest Platform: CloudFormation Severity: <span style="color:#bb2124">High</span> Category: Encryption URL: Check if ElasticSearch encryption is disabled at Rest<br> ```yaml title="Positive test num. 1 - yaml file" hl_lines="16" AWSTemplateFormatVersion: "2010-09-09" Description: Creates RDS Cluster Resources: ElasticsearchDomain: Type: AWS::Elasticsearch::Domain Properties: DomainName: "test" ElasticsearchClusterConfig: DedicatedMasterEnabled: "true" InstanceCount: "2" ZoneAwarenessEnabled: "true" InstanceType: "m3.medium.elasticsearch" DedicatedMasterType: "m3.medium.elasticsearch" DedicatedMasterCount: "3" EncryptionAtRestOptions: Enabled: false EBSOptions: EBSEnabled: true Iops: 0 VolumeSize: 20 VolumeType: "gp2" SnapshotOptions: AutomatedSnapshotStartHour: "0" AccessPolicies: Version: "2012-10-17" Statement: Effect: "Allow" Principal: AWS: "arn:aws:iam::123456789012:user/es-user" Action: "es:*" Resource: "arn:aws:es:us-east-1:846973539254:domain/test/*" AdvancedOptions: rest.action.multi.allowexplicitindex: "true" ``` ```yaml title="Positive test num. 2 - yaml file" hl_lines="6" AWSTemplateFormatVersion: "2010-09-09" Description: Creates RDS Cluster Resources: ElasticsearchDomain1: Type: AWS::Elasticsearch::Domain Properties: DomainName: "test" ElasticsearchClusterConfig: DedicatedMasterEnabled: "true" InstanceCount: "2" ZoneAwarenessEnabled: "true" InstanceType: "m3.medium.elasticsearch" DedicatedMasterType: "m3.medium.elasticsearch" DedicatedMasterCount: "3" EBSOptions: EBSEnabled: true Iops: 0 VolumeSize: 20 VolumeType: "gp2" SnapshotOptions: AutomatedSnapshotStartHour: "0" AccessPolicies: Version: "2012-10-17" Statement: Effect: "Allow" Principal: AWS: "arn:aws:iam::123456789012:user/es-user" Action: "es:*" Resource: "arn:aws:es:us-east-1:846973539254:domain/test/*" AdvancedOptions: rest.action.multi.allowexplicitindex: "true" ``` ```json title="Positive test num. 3 - json file" hl_lines="8" { "Description": "Creates RDS Cluster", "Resources": { "ElasticsearchDomain": { "Type": "AWS::Elasticsearch::Domain", "Properties": { "EncryptionAtRestOptions": { "Enabled": false }, "EBSOptions": { "EBSEnabled": true, "Iops": 0, "VolumeSize": 20, "VolumeType": "gp2" }, "SnapshotOptions": { "AutomatedSnapshotStartHour": "0" }, "AccessPolicies": { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::123456789012:user/es-user" }, "Action": "es:*", "Resource": "arn:aws:es:us-east-1:846973539254:domain/test/*" } ] }, "AdvancedOptions": { "rest.action.multi.allowexplicitindex": "true" }, "DomainName": "test", "ElasticsearchClusterConfig": { "DedicatedMasterType": "m3.medium.elasticsearch", "DedicatedMasterCount": "3", "DedicatedMasterEnabled": "true", "InstanceCount": "2", "ZoneAwarenessEnabled": "true", "InstanceType": "m3.medium.elasticsearch" } } } }, "AWSTemplateFormatVersion": "2010-09-09" } ``` <details><summary>Positive test num. 4 - json file</summary> ```json hl_lines="5" { "Resources": { "ElasticsearchDomain1": { "Type": "AWS::Elasticsearch::Domain", "Properties": { "DomainName": "test", "ElasticsearchClusterConfig": { "InstanceCount": "2", "ZoneAwarenessEnabled": "true", "InstanceType": "m3.medium.elasticsearch", "DedicatedMasterType": "m3.medium.elasticsearch", "DedicatedMasterCount": "3", "DedicatedMasterEnabled": "true" }, "EBSOptions": { "EBSEnabled": true, "Iops": 0, "VolumeSize": 20, "VolumeType": "gp2" }, "SnapshotOptions": { "AutomatedSnapshotStartHour": "0" }, "AccessPolicies": { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::123456789012:user/es-user" }, "Action": "es:*", "Resource": "arn:aws:es:us-east-1:846973539254:domain/test/*" } ] }, "AdvancedOptions": { "rest.action.multi.allowexplicitindex": "true" } } } }, "AWSTemplateFormatVersion": "2010-09-09", "Description": "Creates RDS Cluster" } ``` </details> ```yaml title="Negative test num. 1 - yaml file" AWSTemplateFormatVersion: "2010-09-09" Description: Creates RDS Cluster Resources: ElasticsearchDomain: Type: AWS::Elasticsearch::Domain Properties: DomainName: "test" ElasticsearchClusterConfig: DedicatedMasterEnabled: "true" InstanceCount: "2" ZoneAwarenessEnabled: "true" InstanceType: "m3.medium.elasticsearch" DedicatedMasterType: "m3.medium.elasticsearch" DedicatedMasterCount: "3" EncryptionAtRestOptions: Enabled: true EBSOptions: EBSEnabled: true Iops: 0 VolumeSize: 20 VolumeType: "gp2" SnapshotOptions: AutomatedSnapshotStartHour: "0" AccessPolicies: Version: "2012-10-17" Statement: Effect: "Allow" Principal: AWS: "arn:aws:iam::123456789012:user/es-user" Action: "es:*" Resource: "arn:aws:es:us-east-1:846973539254:domain/test/*" AdvancedOptions: rest.action.multi.allowexplicitindex: "true" ``` ```json title="Negative test num. 2 - json file" { "Resources": { "ElasticsearchDomain": { "Type": "AWS::Elasticsearch::Domain", "Properties": { "AccessPolicies": { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::123456789012:user/es-user" }, "Action": "es:*", "Resource": "arn:aws:es:us-east-1:846973539254:domain/test/*" } ] }, "AdvancedOptions": { "rest.action.multi.allowexplicitindex": "true" }, "DomainName": "test", "ElasticsearchClusterConfig": { "DedicatedMasterCount": "3", "DedicatedMasterEnabled": "true", "InstanceCount": "2", "ZoneAwarenessEnabled": "true", "InstanceType": "m3.medium.elasticsearch", "DedicatedMasterType": "m3.medium.elasticsearch" }, "EncryptionAtRestOptions": { "Enabled": true }, "EBSOptions": { "EBSEnabled": true, "Iops": 0, "VolumeSize": 20, "VolumeType": "gp2" }, "SnapshotOptions": { "AutomatedSnapshotStartHour": "0" } } } }, "AWSTemplateFormatVersion": "2010-09-09", "Description": "Creates RDS Cluster" } ```