Interview Prep/AWS/VPC and Network Design

How do you lock down what can go through a VPC endpoint?

AdvancedProductionVPC and Network Design
Answer

Attach an endpoint policy. For S3, allow only buckets in your organization so a compromised host cannot exfiltrate to an attacker-owned bucket:

{
  "Statement": [{
    "Effect": "Allow", "Principal": "*", "Action": "s3:*", "Resource": "*",
    "Condition": {"StringEquals": {"aws:ResourceOrgID": "o-abc123xyz"}}
  }]
}

Add exceptions for AWS-owned buckets you need (for example Amazon Linux repos, ECR layer bucket). Pair it with bucket policies requiring aws:SourceVpce for sensitive buckets.

aws All AWS questions Roadmap: AWS core services

More on VPC and Network Design