Ensure EBS volume snapshots are encrypted
Description
Elastic Compute Cloud (EC2) supports encryption at rest when using the Elastic Block Store (EBS) service.
Rationale
Encrypting data at rest reduces the likelihood that it is unintentionally exposed and can nullify the impact of disclosure if the encryption remains unbroken.
Impact
Existing unencrypted snapshots must be copied with encryption enabled. The original unencrypted snapshots should then be deleted. EBS snapshot volume encryption is configured per snapshot.
Audit Procedure
Using AWS CLI
- Run describe-snapshots:
aws ec2 describe-snapshots --owner-ids <account number> --filter Name=status,Values=completed --query "Snapshots[*].{ID:SnapshotId}"
This will provide a list of all the snapshots associated with that account in the region.
For every snapshot listed - Run describe-snapshots:
aws ec2 describe-snapshots --snapshot-id <snap-name> --query "Snapshots[*].{Encrypt:Encrypted}"
- If the output reads
"Encrypt": true, Encryption is set on the snapshot.
If the output reads "Encrypt": false refer to the remediation below.
Note: EBS snapshot volume encryption is configured per snapshot.
Using AWS Console
- Login to the EC2 console using https://console.aws.amazon.com/ec2/
- Under
Elastic Block Store, clickSnapshots. - Click the snapshot you want to review.
- Select the
Descriptiontab. - Review the
Encryptionsetting. - If it reads
encryptedyou are all set.
If it is set to Not Encrypted refer to the remediation below.
Note: EBS snapshot volume encryption is configured per snapshot.
Expected Result
All snapshots should return "Encrypt": true from the CLI. In the console, all snapshots should show as encrypted in the Encryption field.
Remediation
Using AWS CLI
Using the snapshot ids gathered from the Audit section:
- Run copy-snapshot:
aws ec2 copy-snapshot --source-region <region> --source-snapshot-id <snap-id> --description "Name of the new snapshot" --encrypted
This will copy the existing unencrypted snapshot and set it to encrypted. The output will show the new SnapshotId.
Run describe-snapshots:
aws ec2 describe-snapshots --owner-ids <account id> --filter Name=status,Values=completed --query "Snapshots[*].{ID:SnapshotId}"
Once the new Snapshot shows in the list confirm encryption is set:
- Run describe-snapshots:
aws ec2 describe-snapshots --snapshot-id <snap-name> --query "Snapshots[*].{Encrypt:Encrypted}"
- Repeat steps 1-4 for the snapshots that need to be encrypted.
Delete snapshots that are no longer needed:
- Run delete-snapshot:
aws ec2 delete-snapshot --snapshot-id <snap-name>
- Repeat for all unencrypted snapshots that have been copied and encrypted.
Note: EBS snapshot volume encryption is configured per snapshot.
Using AWS Console
- Login to the EC2 console using https://console.aws.amazon.com/ec2/
- Under
Elastic Block Store, clickSnapshots. - Select the snapshot you want to encrypt.
- Click on
ActionsselectCopy.
Confirm `Snapshot ID`
Set the `Destination Region`
Update the `Description`
Select the check box for `Encryption`
- Check the box for
Encrypt this snapshot. - Set the
Master Key. - Click on
Copy. - Repeat steps 3-7 for the snapshots that need to be encrypted.
- Delete any of the unencrypted snapshots that are not longer needed.
Note: EBS snapshot volume encryption is configured per snapshot.
Default Value
By default, EBS snapshots are not encrypted. Encryption must be explicitly enabled when creating or copying snapshots.
References
- https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html
- https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/describe-snapshots.html
- https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/delete-snapshot.html
- https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/copy-snapshot.html
CIS Controls
| Controls Version | Control | IG 1 | IG 2 | IG 3 |
|---|---|---|---|---|
| v8 | 3.11 Encrypt Sensitive Data at Rest | x | x | |
| v7 | 14.8 Encrypt Sensitive Information at Rest | x |
Profile
Level 1 | Automated