Description
Check the EC2 launch template’s root and additional EBS mappings. An encrypted source snapshot or regional EBS encryption default can encrypt a new volume even when the template does not request encryption.
Potential impact
Reusing the template can create more volumes that fall short of encryption requirements.
Remediation
Enable encryption on the required EBS mappings and check Auto Scaling’s KMS permissions. Migrate immutable legacy launch configurations to a launch template. Select the new template version on the group, verify volume encryption and data access on a new instance, then roll it out gradually. Plan migration and downtime for existing data separately.
Examples
Both templates add a blank EBS data volume. Supply the actual ami_id and security group IDs, and check that /dev/sdf is free in the AMI’s mappings. Instance store is separate from EBS.
No explicit encryption request
- name: EBS encryption for new instances
amazon.aws.ec2_launch_template:
name: special
image_id: "{{ ami_id }}"
security_group_ids: "{{ security_group_ids }}"
instance_type: t3.micro
block_device_mappings:
- device_name: /dev/sdf
ebs:
volume_size: 100
volume_type: gp3
delete_on_termination: true
encrypted: false
Request encryption for the new data volume
- name: EBS encryption for new instances
amazon.aws.ec2_launch_template:
name: special
image_id: "{{ ami_id }}"
security_group_ids: "{{ security_group_ids }}"
instance_type: t3.micro
block_device_mappings:
- device_name: /dev/sdf
ebs:
volume_size: 100
volume_type: gp3
delete_on_termination: true
encrypted: true
The second template requests encryption for /dev/sdf. Configure the root volume and the group’s template selection separately.