A company runs long-running analytics on data stored in Amazon S3. The jobs run on Amazon EC2 instances in a private subnet with no internet access, using an Auto Scaling group. The EC2 instances and S3 buckets are in the same AWS account and use an S3 gateway VPC endpoint with the default policy. Each instance’s profile role explicitly allows s3:GetObject and s3:PutObject only for the required S3 buckets. The company discovers that one or more instances are compromised and are exfiltrating data to an S3 bucket outside the company’s AWS Organizations organization. A security engineer must stop the exfiltration while keeping the processing jobs operational. Which solution will meet these requirements?
Choose an answer
Tap an option to check your answer.
Correct answer: Update the policy on the S3 gateway endpoint to allow S3 actions only if the aws:ResourceOrgID and aws:PrincipalOrgID condition keys match the company’s values..
Why this is the answer
The S3 gateway endpoint policy is the most effective control point because it applies to all traffic from the private subnet to S3. By adding conditions that require both aws:ResourceOrgID (the bucket's organization) and aws:PrincipalOrgID (the instance's organization) to match the company's values, you prevent data exfiltration to S3 buckets outside the organization while allowing legitimate operations within it. Updating the instance profile role policy is insufficient because a compromised instance could still use its credentials to access external S3 buckets if the endpoint policy allows it. Adding a network ACL rule to block outbound port 443 would stop all S3 access, breaking legitimate processing jobs. An SCP on the AWS account would be too broad and might affect other workloads or accounts, and it wouldn't prevent a compromised instance from using its allowed permissions if the endpoint policy is permissive.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed