Back to Checks
iac

EBS volumes must be encrypted

AWS-0026
Service: ec2Severity: high
OfficialBuilt-inVerified

By enabling encryption on EBS volumes you protect the volume, the disk I/O and any derived snapshots from compromise if intercepted.

Run this check with Prowler

Run in Prowler Cloud
Run
prowler iac --checks AWS-0026

Recommendation

Enable encryption of EBS volumes

Check Code

# METADATA
# title: EBS volumes must be encrypted
# description: |
#   By enabling encryption on EBS volumes you protect the volume, the disk I/O and any derived snapshots from compromise if intercepted.
# scope: package
# schemas:
#   - input: schema["cloud"]
# related_resources:
#   - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html
# custom:
#   id: AWS-0026
#   long_id: aws-ec2-enable-volume-encryption
#   aliases:
#     - AVD-AWS-0026
#     - enable-volume-encryption
#     - aws-ebs-enable-volume-encryption
#     - aws-ec2-enable-volume-encryption
#   provider: aws
#   service: ec2
#   severity: HIGH
#   recommended_action: Enable encryption of EBS volumes
#   input:
#     selector:
#       - type: cloud
#         subtypes:
#           - service: ec2
#             provider: aws
#   examples: checks/cloud/aws/ec2/enable_volume_encryption.yaml
package builtin.aws.ec2.aws0026

import rego.v1

import data.lib.cloud.metadata

deny contains res if {
	some volume in input.aws.ec2.volumes
	isManaged(volume)
	not volume.encryption.enabled.value
	res := result.new(
		"EBS volume is not encrypted.",
		metadata.obj_by_path(volume, ["encryption", "enabled"]),
	)
}