AIP-C01 练习题

AIP-C01 题目讲解:伙伴访问用受限可假设角色

AIP-C01 练习题讲解。答案 C。不建长期用户、不共享 key,使用 STS 临时角色会话。

AIP-C01 免费试练题 · 考证匠讲解

题目

A developer needs to provide an external partner access to a specific Amazon Bedrock Knowledge Base. The partner uses a different AWS account. The developer wants to avoid creating long-term IAM users or sharing keys. What is the most secure method to grant this access?

A. Create an IAM User in the developer's account, generate access keys, and store them in AWS Secrets Manager with a resource policy that allows the partner's account to retrieve the secret.
B. Configure a resource-based policy on the Knowledge Base that grants the partner's root user ARN the bedrock:Retrieve action. This policy includes a Principal element specifying the partner's AWS account root.
C. Create an IAM Role in the developer's account with a trust policy allowing the partner's account to assume it. Attach a policy granting bedrock:Retrieve on the Knowledge Base.
D. Make the Knowledge Base public and use a presigned URL for access. The developer generates a time-limited presigned URL that the partner can use to query the Knowledge Base without any AWS credentials.

答案

答案 C。不建长期用户、不共享 key,使用 STS 临时角色会话。

拆题

  • 不建长期用户、不共享 key,使用 STS 临时角色会话。
  • 数据拥有账号建 role,trust 限定伙伴受控身份,permission 只给指定 KB Retrieve。
  • 第三方伙伴可结合 ExternalId、会话期限和来源条件防 confused deputy;双方策略需配合。

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

  • A:分享用户 key 即使放 Secrets Manager 仍是长期凭证,违背要求。
  • B:KB 不一定支持题述通用 resource policy 方式,root ARN 也不是推荐的日常伙伴操作身份。
  • C(正确):目标账号角色被伙伴合法身份 assume,获得短期限定读取权限,匹配安全需求。
  • D:Knowledge Base 不是可公开后用 S3 式 presigned URL 任意查询的服务对象,假定能力不存在。

放到具体场景里

教学例子:伙伴 PartnerAppRole assume OwnerKBReader,附 ExternalId,临时凭证只允许 Retrieve 指定 KB ARN。查询其他 KB 被拒;记录 CloudTrail 会话主体与伙伴请求 ID。RetrieveAndGenerate 是不同操作,如确需它再明确授予,不能用 broad bedrock:* 省事。

检查对象本例条件或动作结果与边界
信任伙伴指定 role + ExternalId谁能获得会话
权限指定 KB Retrieve最小资源与动作
有效期STS session临时而非共享 key

遇到同类题的判断顺序

  1. 创建目标 role:信任明确伙伴身份。
  2. 授予 KB 权限:动作资源收窄。
  3. 配置双方:伙伴获 AssumeRole 权限。
  4. 负向验收:其他 KB 与越权动作拒绝。
结论:trust 决定谁能进入角色,permission 决定进入后能做什么。

参考资料

继续练这门考试

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