Description
The account’s regional encryption default can encrypt a new ECS disk even when Terraform omits encrypted. Someone who gains access to the storage of an unencrypted disk may be able to read its files.
Potential impact
Exposure of the storage medium can reveal plaintext data and violate encryption-at-rest requirements.
Remediation
Set encrypted = true for new disks and specify kms_key_id if you need a particular key. For an existing unencrypted data disk, make an encrypted copy of its snapshot and create a replacement disk from that copy. Verify the data before switching.
Examples
The examples use the legacy alicloud_disk resource form. Supply an available KMS key ID and preserve data before replacing the disk.
Before
hcl
resource "alicloud_disk" "data_disk" {
availability_zone = "cn-beijing-b"
name = "New-disk"
description = "Hello ecs disk."
category = "cloud_efficiency"
size = "30"
encrypted = false
}
After
hcl
resource "alicloud_disk" "data_disk" {
availability_zone = "cn-beijing-b"
name = "New-disk"
description = "Hello ecs disk."
category = "cloud_efficiency"
size = "30"
encrypted = true
kms_key_id = var.kms_key_id
}