AWS > Ec2 >

Volume Encryption Customer Key

LOW
Source
Trivy
ID
AVD-AWS-0027

EBS volume encryption should use Customer Managed Keys

Encryption using AWS keys provides protection for your EBS volume. To increase control of the encryption and manage factors like rotation use customer managed keys.

Impact

Follow the appropriate remediation steps below to resolve the issue.

Enable encryption using customer managed keys

1
2
3
4
5
Resources:
  GoodExample:
    Type: AWS::EC2::Volume
    Properties:
      KmsKeyId: alias/volumeEncrypt
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
Resources:
  MyKey:
    Type: AWS::KMS::Key
    Properties:
      KeyPolicy:
        Version: "2012-10-17"
        Id: key-default-1

  GoodExample:
    Type: AWS::EC2::Volume
    Properties:
      KmsKeyId: !Ref MyKey

Enable encryption using customer managed keys

1
2
3
4
5
6
7
resource "aws_kms_key" "ebs_encryption" {
  enable_key_rotation = true
}

resource "aws_ebs_volume" "example" {
  kms_key_id = aws_kms_key.ebs_encryption.arn
}