SOA-C03 练习题

SOA-C03 题目讲解:私有 S3 仅允许 CloudFront origin 身份

SOA-C03 练习题讲解。答案 C。目标是禁止直接 S3 公网访问,CloudFront 用授权 origin 身份读桶。

SOA-C03 免费试练题 · 考证匠讲解

题目

An Amazon CloudFront distribution has a single Amazon S3 bucket as its origin. A SysOps administrator must ensure that users can access the S3 bucket only through requests from the CloudFront endpoint. Which solution will meet these requirements?

A. Configure S3 Block Public Access on the S3 bucket. Update the S3 bucket policy to allow the GetObject action from only the CloudFront distribution.
B. Configure Origin Shield in the CloudFront distribution. Update the CloudFront origin to include a custom Origin_Shield header.
C. Create an origin access identity (OAI). Assign the OAI to the CloudFront distribution. Update the S3 bucket policy to restrict access to the OAI.
D. Create an origin access identity (OAI). Assign the OAI to the S3 bucket. Update the CloudFront origin to include a custom Origin header with the OAI value.

答案

答案 C。目标是禁止直接 S3 公网访问,CloudFront 用授权 origin 身份读桶。

拆题

  • 目标是禁止直接 S3 公网访问,CloudFront 用授权 origin 身份读桶。
  • 旧 OAI 可满足题库 C,当前新部署优先 OAC 并以 distribution SourceArn 限定。
  • S3 Block Public Access 与正确 bucket policy 共同作用,不能只加自定义 header。

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

  • A:方向接近当前 OAC 方案,但选项缺少 OAC/signing identity 配置;只写 distribution 而未建立 origin 授权不完整。
  • B:Origin Shield 提高缓存复用,不是源站访问授权;自定义 header 不保护普通 S3 REST 读取。
  • C(正确):旧 OAI 绑定 distribution,bucket 仅允许该 identity 读,符合题目完整方案。
  • D:OAI 不是靠自定义 Origin header 传递的密码,分配位置与机制写错。

放到具体场景里

教学例子:桶保持 private,CloudFront 经 OAC 签名读取,bucket policy 允许 CloudFront service principal 并限定 distribution ARN。测试 CloudFront URL 200、S3 URL 403。原 C 使用 OAI 是可识别的旧方案,讲解不把它伪装成当前推荐。

检查对象本例条件或动作结果与边界
公开入口CloudFront URL允许访问
源桶private S3直接访问拒绝
授权OAI 旧 / OAC 新机制不同于 header

遇到同类题的判断顺序

  1. 关闭公开:启用桶的公开访问阻止。
  2. 绑定 origin:正确 OAI/OAC 身份。
  3. 限制策略:只允许受控分发读取。
  4. 双路验收:CloudFront 成功,S3 直连拒绝。
结论:缓存层和授权层不同,Origin Shield 不能充当源站身份。

参考资料

继续练这门考试

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