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通信,所以互联网网关对本次请求影响不大。