SCS-C02 练习题

SCS-C02 题目讲解:CloudFormation 取秘密用 dynamic reference

SCS-C02 练习题讲解。答案 A。模板不应保存数据库明文密码。

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

题目

A company needs to follow security best practices to deploy resources from an AWS CloudFormation template. The CloudFormation template must be able to configure sensitive database credentials. The company already uses AWS Key Management Service (AWS KMS) and AWS Secrets Manager. Which solution will meet the requirements?

A. Use a dynamic reference in the CloudFormation template to reference the database credentials in Secrets Manager.
B. Use a parameter in the CloudFormation template to reference the database credentials. Encrypt the CloudFormation template by using AWS KMS.
C. Use a SecureString parameter in the CloudFormation template to reference the database credentials in Secrets Manager.
D. Use a SecureString parameter in the CloudFormation template to reference an encrypted value in AWS KMS.

答案

答案 A。模板不应保存数据库明文密码。

拆题

  • 模板不应保存数据库明文密码。
  • dynamic reference 在资源创建/更新时从 Secrets Manager 获取秘密,不把它当普通明文参数提交。
  • 更新秘密不保证所有已有资源自动更新,轮换与应用读取要按服务集成验证。

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

  • A(正确):Secrets Manager dynamic reference 是题中受支持的敏感值引用方式。
  • B:加密整个模板不解决 CloudFormation 执行时普通参数可能暴露的问题。
  • C:SecureString 是 SSM Parameter Store 参数类型,不是 CloudFormation 指向 Secrets Manager 的通用参数类型。
  • D:KMS 存密钥而非独立业务秘密值,“SecureString in KMS”混淆服务。

放到具体场景里

教学例子:RDS 的 MasterUserPassword 使用 Secrets Manager reference,执行角色只可取指定 secret 和相关 key。不要把 secret 值输出到 Outputs,也检查资源是否把密码放进名称、日志或持久属性;dynamic reference 不是所有位置的自动脱敏器。

检查对象本例条件或动作结果与边界
模板引用 secret 标识不存明文
运行身份受限 GetSecretValue最小权限
暴露检查Outputs / 日志 / 标识避免间接泄露

遇到同类题的判断顺序

  1. 建立秘密:Secrets Manager 管理凭证。
  2. 添加引用:模板用受支持语法。
  3. 限定角色:只可取所需 secret。
  4. 验证更新:检查轮换、资源和应用使用。
结论:KMS 加密密钥,Secrets Manager 存凭证,dynamic reference 连接模板与秘密。

参考资料

继续练这门考试

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