Description
EBS encrypts new volumes when encryption by default is enabled in the Region or the source snapshot is encrypted. An omitted or false value in the playbook alone cannot tell you the deployed volume’s encryption state.
Potential impact
Unencrypted volumes and snapshots can leave stored data outside your encryption policy. Operating-system and application permissions and TLS for application traffic still need separate controls.
Remediation
For a new volume, set encrypted: true and check the KMS key and permissions. To encrypt data on an existing volume, create an encrypted volume from a consistent snapshot or copy the data to a new encrypted volume. Plan the attachment change and downtime. Verify volume and snapshot encryption, the key and workload operation before retiring the source.
Examples
Set instance_id to the target instance and choose an attachment device appropriate for it.
Configuration without an encryption request
---
- name: Creating EBS volume01
amazon.aws.ec2_vol:
instance: "{{ instance_id }}"
encrypted: false
volume_size: 50
volume_type: gp2
device_name: /dev/xvdf
This task specifies no source snapshot. With encrypted: false, check the Region’s encryption default and the actual volume state.
Request encryption for a new volume
- name: Creating EBS volume05
amazon.aws.ec2_vol:
instance: "{{ instance_id }}"
encrypted: yes
volume_size: 50
volume_type: gp2
device_name: /dev/xvdf
encrypted: yes requests encryption for a new volume. A volume already attached to the instance keeps its encryption state.