为什么在禁用 KMS 密钥后我仍然能够读取 EC2 中加密的 EBS 卷数据?

Why am I still able to read encrypted EBS volume data in EC2 even after disabling the KMS key?

我正在尝试验证 AWS 中 EBS 卷的数据加密。我已经使用 KMS 密钥加密了一个 EBS 卷并将其安装在 EC2 实例上。我在这个卷中有一些文件,我希望如果我禁用 KMS 密钥,我将无法读取 EBS 卷中的文件,但这种情况没有发生。我猜测可能是在将 EBS 卷附加到 EC2 实例时,我们需要密钥。在那之后,即使我们禁用密钥,我们仍然可以读取数据。我的理解正确吗?

来自docs

For each volume, Amazon EBS asks AWS KMS to generate a unique data key encrypted under the CMK that you specify. Amazon EBS stores the encrypted data key with the volume. Then, when you attach the volume to an Amazon EC2 instance, Amazon EBS calls AWS KMS to decrypt the data key. Amazon EBS uses the plaintext data key in hypervisor memory to encrypt all disk I/O to the volume.

实例实际上只在启动时调用一次KMS并附加卷来解密数据密钥。之后它会将其保存在内存中,因为每次调用 KMS 都需要很长时间。因此,只要实例是 运行.

,你用密钥做什么都不重要

我的假设是,每当您停止和启动实例或将卷附加到另一个实例时,某些事情就会失败,因为它随后会尝试从 KMS 获取密钥。

有关更多详细信息,我建议您查看 complete documentation on EBS encryption

我是 AWS 新手,但目前使用 KMS 密钥加密 S3 存储桶。我碰巧遇到了同样的问题。即使禁用它,我也能够访问文件。但是,5-10 分钟后,我无法访问。所以,我认为它不会立即反映出来。