A company has configured a gateway VPC endpoint in a VPC. Only Amazon EC2 instances that reside in a single subnet in the VPC can use the endpoint. The company has modified the route table for this single subnet to route traffic to Amazon S3 through the gateway VPC endpoint. The VPC provides internet access through an internet gateway. A security engineer attempts to use instance profile credentials from an EC2 instance to retrieve an object from the S3 bucket, but the attempt fails. The security engineer verifies that the EC2 instance has an IAM instance profile with the correct permissions to access the S3 bucket and to retrieve objects. The security engineer also verifies that the S3 bucket policy is allowing access properly. Additionally, the security engineer verifies that the EC2 instance’s security group and the subnet's network ACLs allow the communication.
What else should the security engineer check to determine why the request from the EC2 instance is failing?
A. Verify that the EC2 instance’s security group does not have an implicit inbound deny rule for Amazon S3.
B. Verify that the VPC endpoint’s security group does not have an explicit inbound deny rule for the EC2 instance.
C. Verify that the internet gateway is allowing traffic to Amazon S3.
D. Verify that the VPC endpoint policy is allowing access to Amazon S3.
D
一家公司在一個虛擬私有云(VPC)中配置了一個網關型虛擬私有云終端節點(gateway VPC endpoint)。只有位于該VPC中單個子網內的亞馬遜彈性計算云(Amazon EC2)實例才能使用該終端節點。公司已修改此單個子網的路由表,以通過網關型VPC終端節點將流量路由至亞馬遜簡單存儲服務(Amazon S3)。該VPC通過互聯網網關提供互聯網訪問。一位安全工程師嘗試使用來自EC2實例的實例配置文件憑證從S3存儲桶中檢索對象,但嘗試失敗。安全工程師驗證了該EC2實例具有訪問S3存儲桶和檢索對象的正確權限的IAM實例配置文件。安全工程師還驗證了S3存儲桶策略正確允許訪問。此外,安全工程師驗證了EC2實例的安全組和子網的網絡訪問控制列表(NACL)允許通信。
安全工程師還應檢查什么來確定EC2實例發出的請求失敗的原因?
公司在VPC配置網關型VPC終端節點,僅特定子網內EC2實例可用,修改該子網路由表通過終端節點路由流量至S3,VPC通過互聯網網關提供互聯網訪問。安全工程師用EC2實例配置文件憑證從S3檢索對象失敗,已驗證實例IAM配置文件、S3存儲桶策略、實例安全組和子網NACL均允許訪問,需找出請求失敗的其他原因。
技巧:排除明顯錯誤選項,在沒有明顯錯誤的選項中選擇最合理的選項。
A. 不正確。驗證EC2實例的安全組沒有針對Amazon S3的隱式入站拒絕規則。EC2實例安全組通常不會對S3設置隱式入站拒絕規則,因為S3是外部服務,安全組主要控制進出實例的流量,對S3的訪問控制更多通過IAM策略、終端節點策略等。
B. 不正確。驗證VPC終端節點的安全組沒有針對EC2實例的顯式入站拒絕規則。雖然VPC終端節點安全組的規則設置會影響訪問,但題目中請求失敗更可能是終端節點策略對S3訪問的控制問題,而非安全組對EC2實例的顯式入站拒絕規則,因為重點是能否訪問S3,而非EC2實例入站情況。
C. 不正確。驗證互聯網網關允許到Amazon S3的流量。在此場景中,流量通過VPC終端節點路由至S3,不依賴互聯網網關與S3通信,所以互聯網網關是否允許到S3的流量與本次請求失敗無關。
D. 正確。驗證VPC終端節點策略允許訪問Amazon S3。VPC終端節點策略用于控制對通過該終端節點訪問的AWS服務的訪問權限。如果策略不允許訪問S3,即使其他安全設置(如IAM實例配置文件、存儲桶策略、安全組、NACL)都允許,請求也會失敗,所以此選項是安全工程師應檢查的關鍵內容。
VPC終端節點策略:VPC終端節點策略用于控制對通過該終端節點訪問的AWS服務的訪問權限。如果策略不允許訪問特定服務(如Amazon S3),即使其他安全設置允許,請求也會失敗。
安全組設置:安全組用于控制進出EC2實例或VPC終端節點的流量。如果安全組有不當的入站或出站規則,可能會阻止請求。但通常EC2實例安全組不會對S3有隱式入站拒絕規則,而VPC終端節點安全組的規則設置更為關鍵。
互聯網網關:互聯網網關主要用于VPC與互聯網之間的通信。但在此場景中,流量是通過VPC終端節點路由至S3,不依賴互聯網網關與S3通信,所以互聯網網關對本次請求影響不大。