Company A has an AWS account that is named Account A. Company A recently acquired Company B, which has an AWS account that is named Account B. Company B stores its files in an Amazon S3 bucket. The administrators need to give a user from Account A full access to the S3 bucket in Account B.
After the administrators adjust the IAM permissions for the user in Account A to access the S3 bucket in Account B, the user still cannot access any files in the S3 bucket. Which solution will resolve this issue?
A. In Account B, create a bucket ACL to allow the user from Account A to access the S3 bucket in Account B.
B. In Account B, create an object ACL to allow the user from Account A to access all the objects in the S3 bucket in Account B.
C. In Account B, create a bucket policy to allow the user from Account A to access the S3 bucket in Account B.
D. In Account B, create a user policy to allow the user from Account A to access the S3 bucket in Account B.
C
技巧:排除明顯錯誤選項,在沒有明顯錯誤的選項中選擇最合理的選項。
? 題干翻譯
A 公司有一個名為 account A 的 AWS 帳戶。A 公司最近收購了 B 公司,后者有一個名稱為 account B 的 AWS 帳戶,B 公司將其文件存儲在 Amazon S3 存儲桶中。管理員需要授予帳戶 a 中的用戶對帳戶 B 中 S3 存儲桶的完全訪問權限。管理員調整帳戶 A 中用戶訪問帳戶 B 中 S3 存儲桶的 IAM 權限后,用戶仍然無法訪問 S3 存儲桶中的任何文件。哪種解決方案可以解決這個問題?
? 概括問題:
Account A 和 Account B 是兩個獨立的 AWS 賬戶。Account B 擁有一個 S3 存儲桶(Bucket),存儲了文件。Account A 的一個 IAM 用戶需要獲得 Account B 的 S3 存儲桶的完全訪問權限。
? 技術要點:
要使 Account A 的 IAM 用戶 能夠訪問 Account B 的 S3 存儲桶,必須由 Account B 的管理員在 Account B 的 S3 存儲桶上顯式授予權限。AWS 提供了幾種方式來實現跨賬戶訪問:
Bucket Policy(存儲桶策略)(推薦),是最靈活、最常用的方式,可以精確控制誰可以訪問存儲桶及其內容,可針對 IAM 用戶、角色、另一個 AWS 賬戶等主體授權。
Bucket ACL(存儲桶訪問控制列表),不能直接針對單個 IAM 用戶授權,通常用于賬戶級別的權限管理,僅支持賬戶級別的權限(如 AWS Account ID)。
Object ACL(對象訪問控制列表),不能直接針對單個 IAM 用戶授權,通常用于賬戶級別的權限管理,針對單個對象的權限,管理粒度過細,不適用批量授權。
IAM Role(IAM 角色)(但題目問的是直接給用戶權限,不涉及角色)
另外,要注意:
User Policy 僅適用于當前賬戶的 IAM 用戶,不能用于跨賬戶授權。
A. 不正確。在 Account B 中創建 Bucket ACL,允許 Account A 的用戶訪問 S3 存儲桶。Bucket ACL 僅支持賬戶級別授權(如 AWS Account ID),無法直接指定單個 IAM 用戶。即使通過 Account A 的賬戶 ID 授權,用戶仍需通過 IAM 角色或臨時憑證訪問,無法直接使用其 IAM 用戶身份。
B. 不正確。在 Account B 中創建 Object ACL,允許 Account A 的用戶訪問存儲桶中的所有對象。Object ACL 是針對單個對象的權限,無法批量應用于整個存儲桶。同樣無法直接授權單個 IAM 用戶,僅支持賬戶或公開訪問。
C. 正確。在 Account B 中創建 Bucket Policy,允許 Account A 的用戶訪問 S3 存儲桶。Bucket Policy 可精確控制誰(如 IAM 用戶 ARN)可以訪問存儲桶,并支持授予 3:*(完全權限)。
D. 不正確。在 Account B 中創建 User Policy,允許 Account A 的用戶訪問 S3 存儲桶。User Policy 是 Account B 自身 IAM 用戶的權限策略,無法用于授權其他賬戶的用戶。跨賬戶授權必須通過 Bucket Policy 或資源共享機制(如 RAM)。