DOP-C02 练习题

DOP-C02 题目讲解:EBS 加密是迁移卷,不是原地开关

DOP-C02 练习题讲解。答案 A。已有未加密卷不能直接切换为加密卷,需要快照和新卷。

DOP-C02 免费试练题 · 考证匠讲解

题目

A company requires that all Amazon EBS volumes attached to EC2 instances are encrypted. If an unencrypted EBS volume is detected, it must be automatically encrypted. The DevOps engineer needs to implement this as an automated compliance control. Which solution meets these requirements?

A. Enable the AWS Config managed rule encrypted-volumes. Create a remediation action using a Systems Manager Automation runbook that creates an encrypted snapshot of the unencrypted volume, creates a new encrypted volume from the snapshot, stops the instance, detaches the unencrypted volume, attaches the encrypted volume, and starts the instance.
B. Create a Service Control Policy (SCP) that denies the ec2:CreateVolume action unless the Encrypted parameter is true. Apply the SCP to all accounts in the organization.
C. Enable EBS encryption by default in all Regions for all accounts using the EC2 account-level settings.
D. Create an EventBridge rule that detects CreateVolume API calls. Trigger a Lambda function that checks if the volume is encrypted and deletes it if not.

答案

答案 A。已有未加密卷不能直接切换为加密卷,需要快照和新卷。

拆题

  • 已有未加密卷不能直接切换为加密卷,需要快照和新卷。
  • Config 识别未加密资源,SSM runbook 执行可审计修复,两层配合。
  • 自动化必须包含备份、停机窗口、KMS 权限、设备名和启动验证;不应把迁移当作零风险。

每个选项为什么对、为什么错

  • A(正确):检测后通过加密快照副本与新卷替换完成修复。选项的“创建加密快照”应落实为复制快照时指定加密,再创建卷,不能假设原快照原地加密。
  • B:SCP 可以防止未来部分未加密创建行为,但不会修改历史卷,且应核对实际 API 条件键。
  • C:默认加密主要影响新卷与相关创建流程,不会追溯加密已存在的卷。
  • D:直接删除未加密卷丢失数据,是破坏行为,不是合规修复。

放到具体场景里

教学例子:一台实例的根卷 vol-old 未加密。先保存一致性快照,复制成 KMS 加密快照,创建同 AZ 的 vol-new。在维护窗口停止实例,保留原设备映射替换根卷,再启动检查应用和磁盘。验证完成前保留旧卷,避免失败后无恢复路径。

检查对象本例条件或动作结果与边界
旧卷vol-old 未加密不能原地改状态
加密副本复制快照并创建 vol-new核对 KMS 与 AZ
切换停止、替换、启动验证维护窗口与回退依据

遇到同类题的判断顺序

  1. 检测违规:Config 找出目标卷。
  2. 生成副本:一致性快照复制加密。
  3. 受控替换:停止实例并按设备映射换卷。
  4. 验证闭环:启动成功且规则转为合规。
结论:预防新问题和修复旧数据要分别做;加密默认值不代表旧卷已经加密。

参考资料

继续练这门考试

同一门考试的免费试练题都附这样的完整讲解,做完再看讲解。