Question 1
A company uses an S3 gateway endpoint in a VPC. Security requires that instances in the VPC can reach only the company's own buckets through the endpoint, to prevent data from being copied to other buckets. What should the CloudOps engineer do?
- Add a security group to the gateway endpoint that allows traffic only to the company's bucket IP addresses.
- Add a bucket policy to each company bucket that allows access only from the gateway endpoint ID.
- Attach an endpoint policy to the gateway endpoint that allows S3 actions only on the company's bucket ARNs. — Correct
- Add network ACL rules that deny traffic to S3 prefix list ranges that belong to other buckets.
Correct answer
Attach an endpoint policy to the gateway endpoint that allows S3 actions only on the company's bucket ARNs.
Explanation
Endpoint policies restrict which buckets can be accessed through the endpoint. Gateway endpoints have no security groups. S3 IP ranges are shared by all buckets. Bucket policies on company buckets do not stop writes to other buckets.
Question 2
An application on EC2 instances in private subnets must upload files to S3 and send messages to SQS. The security team requires that this traffic never use the internet or a NAT gateway. Which actions meet these requirements? (Choose TWO.)
- Assign Elastic IP addresses to the instances and restrict outbound rules to AWS IP ranges.
- Create an SQS gateway VPC endpoint and associate it with the private subnets' route tables.
- Create an S3 gateway VPC endpoint and associate it with the private subnets' route tables. — Correct
- Create an SQS interface VPC endpoint with private DNS enabled in the private subnets. — Correct
- Attach an egress-only internet gateway to the VPC and route S3 and SQS traffic to it.
Correct answer
Create an S3 gateway VPC endpoint and associate it with the private subnets' route tables.; Create an SQS interface VPC endpoint with private DNS enabled in the private subnets.
Explanation
S3 supports gateway endpoints, and SQS uses interface endpoints. SQS has no gateway endpoint. Egress-only internet gateways are for IPv6 internet traffic. Elastic IPs still send traffic over the internet.
Question 3
A company's Route 53 private hosted zone is in a networking account. A VPC in an application account must resolve records in this zone. What should the CloudOps engineer do?
- Create a public hosted zone with the same name in the application account and copy the records.
- Create a VPC peering connection between the VPCs, which automatically shares the hosted zone.
- Create a VPC association authorization in the zone's account, then associate the VPC. — Correct
- Share the private hosted zone with the application account by using AWS Resource Access Manager (AWS RAM).
Correct answer
Create a VPC association authorization in the zone's account, then associate the VPC.
Explanation
Cross-account association of a private hosted zone requires an authorization from the zone owner and an association request from the VPC owner. Hosted zones are not shared through RAM. A public zone exposes records. Peering does not share DNS zones.
Question 4
An S3 bucket stores sensitive data and must only be accessed through a specific VPC endpoint. Administrators must still be able to manage the bucket from outside the VPC through a dedicated role. Which bucket policy meets these requirements?
- Allow all S3 actions only when aws:SourceIp matches the VPC's CIDR range, and deny everything else for all principals.
- Deny all S3 actions for all principals and add the administrator role to the bucket's access control list.
- Deny all S3 actions when aws:SourceVpce is not the endpoint ID, except for the admin role's aws:PrincipalArn. — Correct
- Allow s3:GetObject for the endpoint ID and rely on the default implicit deny for all other S3 requests.
Correct answer
Deny all S3 actions when aws:SourceVpce is not the endpoint ID, except for the admin role's aws:PrincipalArn.
Explanation
A conditional deny limits access to the endpoint while exempting the admin role. aws:SourceIp does not contain private VPC addresses for endpoint traffic. A full deny overrides any ACL grant. Relying only on an allow does not restrict principals that have IAM permissions.
Question 5
A Site-to-Site VPN connection to a VPC shows both tunnels as UP, but instances in the VPC cannot reach on-premises servers. The VPN uses a virtual private gateway with dynamic routing. What is the MOST likely cause?
- Route propagation from the virtual private gateway is not enabled on the subnets' route tables. — Correct
- The VPC has DNS hostnames turned off, so on-premises servers cannot be reached by IP address.
- The customer gateway device is advertising routes with a BGP ASN that matches the AWS side.
- The VPN connection uses two tunnels, and only one tunnel can be active at the same time.
Correct answer
Route propagation from the virtual private gateway is not enabled on the subnets' route tables.
Explanation
Without route propagation or static routes to the virtual private gateway, VPC traffic to the on-premises network has no route. Having both tunnels up is normal. An ASN conflict would prevent BGP sessions from establishing. DNS settings do not affect IP routing.
Question 6
A web application uses CloudFront with an ALB origin. The company wants to make sure that the ALB accepts traffic only from CloudFront. Which solution meets this requirement?
- Allow inbound traffic to the ALB only from the CloudFront distribution's domain name in a security group rule on the load balancer.
- Enable geographic restrictions on the distribution so that the ALB receives traffic only from CloudFront.
- Make the ALB internal, and configure CloudFront to send requests to the ALB's private IP addresses inside the VPC as a custom origin.
- Allow only the CloudFront origin-facing managed prefix list on the ALB, and check a secret custom header. — Correct
Correct answer
Allow only the CloudFront origin-facing managed prefix list on the ALB, and check a secret custom header.
Explanation
The CloudFront prefix list limits sources to CloudFront, and a secret header ensures requests come from your distribution. Security groups cannot reference domain names. A standard origin cannot be an internal ALB without VPC origins. Geo restriction does not protect the ALB.
Question 7
A company's AWS bill shows high charges for NAT gateway data processing. Most of the traffic is from EC2 instances in private subnets downloading objects from S3 in the same Region. What is the MOST cost-effective change?
- Create an S3 gateway VPC endpoint and add it to the private subnets' route tables. — Correct
- Create an S3 interface VPC endpoint in each private subnet with private DNS enabled.
- Replace the NAT gateway with a larger NAT gateway that has a lower per-GB price.
- Move the instances to public subnets and give each instance a public IP address.
Correct answer
Create an S3 gateway VPC endpoint and add it to the private subnets' route tables.
Explanation
Gateway endpoints for S3 have no hourly or data processing charges and take S3 traffic off the NAT gateway. NAT gateways have one price. Interface endpoints have hourly and data charges. Public subnets increase exposure.
Question 8
A security engineer must ensure that EC2 instances can call only specific AWS APIs through an interface VPC endpoint, and only for resources in the company's organization. Which control should the CloudOps engineer apply?
- A network ACL on the endpoint's subnets that allows only the required AWS service API names.
- A route table entry that sends API traffic for other organizations to a blackhole target.
- A security group on the endpoint that allows only the required API actions from the instances.
- A VPC endpoint policy that allows the required actions with a condition on aws:ResourceOrgID. — Correct
Correct answer
A VPC endpoint policy that allows the required actions with a condition on aws:ResourceOrgID.
Explanation
Endpoint policies control which actions and resources can be used through the endpoint, and aws:ResourceOrgID limits access to the organization's resources. Security groups and NACLs filter IPs and ports, not API actions. Route tables cannot distinguish organizations.
Question 9
A company uses CloudFront in front of an ALB for a web application. Users in a country where the company does not operate must be blocked. Which solution meets this requirement with the LEAST effort?
- Enable CloudFront geographic restrictions with a block list for the country. — Correct
- Add security group rules on the ALB that deny the IP ranges for the country.
- Create Route 53 geolocation records that return no answer for the country.
- Add network ACL rules on the ALB subnets that deny the IP ranges for the country.
Correct answer
Enable CloudFront geographic restrictions with a block list for the country.
Explanation
CloudFront geo restriction blocks requests by viewer country at the edge. Maintaining country IP ranges in NACLs is impractical, and security groups have no deny rules. DNS changes can be bypassed by direct access.
Question 10
A company must expose a TCP service to clients that allowlist a fixed IP address per Availability Zone. The service must also see the clients' original source IP addresses. Which load balancer should the CloudOps engineer use?
- A Classic Load Balancer with proxy protocol and an Elastic IP address in each subnet.
- A Gateway Load Balancer with a static IP address for each appliance in the target group.
- An Application Load Balancer with the X-Forwarded-For header and an Elastic IP address.
- A Network Load Balancer with an Elastic IP per subnet and client IP preservation. — Correct
Correct answer
A Network Load Balancer with an Elastic IP per subnet and client IP preservation.
Explanation
NLBs support Elastic IPs per AZ and can preserve client IPs. ALBs and Classic Load Balancers do not support Elastic IPs. Gateway Load Balancers are for inline appliances.