Json Yaml Missing Ebs Encrypted Property
Description
Detects unencrypted EBS (Elastic Block Store) volumes attached to EC2 instances in CloudFormation templates. Unencrypted EBS volumes pose a security risk since the data stored on them is not protected at rest, potentially exposing sensitive information if the physical storage is compromised.
Detection Strategy
• Reviews CloudFormation templates looking for AWS::EC2::Instance resource types
• Examines the BlockDeviceMappings property of EC2 instances
• Reports a vulnerability when an EBS volume is defined without setting the 'Encrypted' property to true
• Checks both root volumes and additional EBS volumes attached to the instance
Vulnerable code example
{
"Resources": {
"VulnerableEC2Instance": {
"Type": "AWS::EC2::Instance",
"Properties": {
"ImageId": "ami-12345678",
"BlockDeviceMappings": [
{...✅ Secure code example
{
"Resources": {
"VulnerableEC2Instance": {
"Type": "AWS::EC2::Instance",
"Properties": {
"ImageId": "ami-12345678",
"BlockDeviceMappings": [
{...Search for vulnerabilities in your apps for free with Fluid Attacks' automated security testing! Start your 21-day free trial and discover the benefits of the Continuous Hacking Essential plan. If you prefer the Advanced plan, which includes the expertise of Fluid Attacks' hacking team, fill out this contact form.