Join our Newsletter — 33% off our NHI Course
Home› Guides› VPC Endpoints vs NAT Gateways: Choosing the Private…
Guide Cloud Security

VPC Endpoints vs NAT Gateways: Choosing the Private Egress Path

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 14 November 2026 17 min read
On this page

A private subnet with a NAT gateway is not private in the way that matters for data loss: any workload or stolen credential behind it can reach any internet destination, including a storage account the attacker owns. VPC endpoints and their equivalents send traffic for named cloud services over the provider network instead, and they carry a policy that can limit which identities and which resources the path may be used for. This guide compares the two egress paths as a design decision: the threat model of each, how each is built, where each fails, what it costs, how DNS decides which path is used, and how to combine them. It is written for cloud network architects, platform engineers and security reviewers deciding how private workloads should reach cloud APIs and the internet. Platforms are listed alphabetically: Amazon Web Services (AWS), Google Cloud and Microsoft Azure; order is never a ranking.

Key takeaways

  • The short answer: use service endpoints for traffic to cloud provider APIs and your own private services, and keep a NAT gateway only for traffic that genuinely needs the internet, filtered by an egress firewall or proxy.
  • A NAT gateway translates addresses, it does not decide destinations. AWS documents that security groups apply to instances rather than to the NAT gateway, so filtering happens on the workload, in network ACLs or in a firewall in the path.
  • An endpoint is an exfiltration control only when its policy is narrowed. The AWS default endpoint policy allows all principals, all actions and all resources, so an untouched endpoint reaches an attacker's bucket as happily as yours.
  • DNS chooses the path. Interface endpoints and private endpoints work through private DNS; when resolution falls back to public names, traffic silently goes out through the NAT gateway and bypasses the endpoint policy.
  • Cost and control point the same way for heavy cloud API traffic. AWS charges NAT gateways per hour and per GB processed and recommends endpoints for AWS service traffic; gateway endpoints for Amazon S3 and DynamoDB carry no additional charge.

The two paths in one table

Both options let a workload without a public IP reach something outside its subnet; they differ in what they reach, who decides and what evidence they leave. The Cloud Private Connectivity Guide explains the producer and consumer model behind private endpoints.

DimensionNAT gatewayVPC endpoint (and equivalents)
What it reachesAny destination the route table and firewall allow, usually the whole internetOne named service, service bundle or private resource
Traffic pathSource address translated to the gateway address, then out through the internet gateway (public NAT)Stays on the provider network; AWS states PrivateLink traffic does not traverse the public internet
Policy pointNone on the gateway; security groups on instances, network ACLs on subnets, firewall rules in the pathEndpoint policy (AWS), service endpoint policy (Azure Storage), VPC Service Controls perimeter (Google Cloud), plus resource policies conditioned on the endpoint
Identity awarenessNone: sees IP addresses and portsEvaluates the principal and resource of each API request
Inbound exposureNo unsolicited inbound connections, only responsesConsumer side reaches the service; the service cannot open connections back into the subnet
DNS dependencyPublic resolutionPrivate DNS zones or resolver rules for interface and private endpoints; route table prefix lists for AWS gateway endpoints
Cost modelHourly charge plus per GB processed (AWS), plus internet data transferInterface endpoints: hourly per Availability Zone plus per GB; AWS gateway endpoints: no additional charge
Evidence leftFlow logs with the gateway's address; destination IP onlyFlow logs plus control plane and data access logs that record the endpoint ID

Threat model: the NAT path

AWS, Azure and Google Cloud all describe managed NAT the same way: connections can only be initiated from inside the network. That is the whole security contract.

  • Exfiltration to an attacker-owned cloud account: a compromised workload uploads data to storage in another tenant at the same provider (T1537 Transfer Data to Cloud Account, T1567.002 Exfiltration to Cloud Storage). The destination is a legitimate provider hostname on port 443, so allow lists that permit the provider's API domains also permit the attacker's bucket.
  • Stolen credentials used from anywhere: unless resource policies require requests to arrive through your network, a leaked workload credential works from the attacker's own machine (T1078.004 Cloud Accounts). See the EC2 Instance Metadata Service Hardening Guide.
  • Command and control and tooling download: outbound HTTPS and other protocols leave unless something filters them (T1048 Exfiltration Over Alternative Protocol).
  • Attribution loss: every workload behind the gateway shares its public address. See the NAT and Its Security Implications Guide.

Threat model: the endpoint path

An endpoint narrows where traffic can go, but adds failure modes of its own, nearly all configuration that looks finished and is not.

  • Full access default policy: AWS attaches a policy allowing all principals, actions and resources when none is supplied, so an unchanged Amazon S3 endpoint reaches any bucket in the Region, including an attacker's.
  • Public path left open: Microsoft states that a private endpoint gives the service a private IP but does not necessarily restrict public access to it. If public network access stays enabled, the resource is still reachable from the internet with a valid credential.
  • Silent bypass: an AWS gateway endpoint applies only to subnets whose route table is associated with it, and not to the same service in another Region. For interface and private endpoints, a client that resolves the public name goes out through NAT instead.
  • Endpoint as an outbound channel: AWS and Google Cloud support endpoints to services published by other organisations, so approve each one like a firewall rule. All three platforms describe an approval state (PendingAcceptance on AWS, a consumer accept list on Google Cloud, Pending on Azure).
  • Overconfidence: an endpoint does nothing about a workload role that can read everything it reaches. In the Capital One Breach 2019 the damage came from what one workload role could read. Endpoints limit where a credential works; least privilege limits what it can do.

How each platform builds the two paths

Every major cloud offers the same pattern: a managed NAT, a low-cost route to provider storage, and a per-resource private endpoint.

Building blockAmazon Web ServicesGoogle CloudMicrosoft Azure
Managed NATNAT gateway, public or private connectivity type; public type sits in a public subnet with an Elastic IPCloud NAT, Public NAT or Private NAT; a distributed software-defined service on the Andromeda stack, not a proxy VMAzure NAT Gateway, attached per subnet; Standard (zonal) and StandardV2 (zone redundant) SKUs
Route to provider APIs without a public IPGateway endpoints (Amazon S3, DynamoDB) through route table prefix listsPrivate Google Access, enabled per subnet, using default, private.googleapis.com or restricted.googleapis.com domainsService endpoints on the subnet, which keep the service's public address and identify the subnet
Private IP for a service or resourceInterface endpoints (AWS PrivateLink), plus resource and service network endpointsPrivate Service Connect endpoints for Google APIs, published services and backendsPrivate endpoints (Azure Private Link), one per resource and sub-resource
Destination restriction for data lossEndpoint policies, paired with resource policies conditioned on the endpoint or VPCVPC Service Controls perimeters, with restricted.googleapis.com limiting access to supported servicesService endpoint policies (allow lists of storage accounts); private endpoints map to one specific resource

Amazon Web Services. Each NAT gateway lives in one Availability Zone, scales from 5 Gbps to 100 Gbps, and supports up to 55,000 simultaneous connections per IPv4 address to each unique destination. Egress rules live on instance security groups and on the network ACL of the NAT subnet. Gateway endpoints add a route for the service prefix list to each associated route table, and security groups need an outbound rule to that prefix list on TCP 443. Endpoint policies use IAM policy language, are limited to 20,480 characters, and for gateway endpoints narrow principals with the aws:PrincipalArn condition. See the Amazon VPC Security Guide and the AWS Resource Control Policies and Data Perimeter Guide.

Google Cloud. Google notes that traffic to Google APIs from VMs using Public NAT still goes through Private Google Access, which is enabled per subnet. The private.googleapis.com range (199.36.153.8/30) covers most Google APIs; restricted.googleapis.com (199.36.153.4/30) covers only services VPC Service Controls supports, and Google describes it as adding data exfiltration protection. Private Service Connect endpoints are internal IP addresses in the consumer VPC. See the VPC Service Controls Guide and the Google Cloud VPC and Cloud NGFW Security Guide.

Microsoft Azure. Azure NAT Gateway replaces the subnet default internet route, and a user-defined 0.0.0.0/0 route to a virtual appliance overrides it. Microsoft states that from 31 March 2026 new virtual networks default to private subnets without default outbound access, so workloads need an explicit outbound method. Service endpoint policies allow listed storage accounts and deny the rest, which Microsoft positions as data exfiltration prevention. Private endpoints get a read-only network interface with a private IP and support network security groups and user-defined routes. See the Azure Virtual Network Security Guide.

Endpoint policies as an exfiltration control

The value of an endpoint is that the route carries an identity-aware rule. A useful data perimeter has three parts.

  1. Only my resources, through my network: narrow each endpoint policy so requests through it may only touch resources owned by your organisation. On AWS this is commonly written with the aws:ResourceOrgID condition; on Azure, a service endpoint policy lists the permitted storage accounts, subscriptions or resource groups; on Google Cloud, a VPC Service Controls perimeter blocks API calls that would move data to projects outside it.
  2. Only my network, for my resources: condition the resource side so it only accepts requests that arrive through your endpoints. On AWS, bucket and key policies commonly use aws:SourceVpce or aws:SourceVpc; on Azure, disable public network access on the resource once its private endpoint is approved; on Google Cloud, the perimeter does this for protected services.
  3. Only my principals: where supported, restrict which principals may use the endpoint, for example with aws:PrincipalArn on gateway endpoints, so a compromised workload in the subnet cannot use a credential from another account through your path.

AWS documents that an endpoint policy does not override identity-based or resource-based policies; it only further limits what passes through. See the Cloud Data Perimeter Guide for the full model.

DNS behaviour: how traffic picks a path

Most endpoint failures are DNS failures. The mechanics differ by endpoint type.

Endpoint typeHow traffic is steeredTypical silent failure
AWS gateway endpointRoute table entry for the service prefix list; public DNS names stay unchanged; longest prefix match means a 0.0.0.0/0 route does not override itSubnet's route table not associated; cross-Region calls; a client that receives AAAA records for an IPv4-only endpoint does not use it
AWS interface endpointPrivate DNS so the public service name resolves to endpoint interface addresses inside the VPC (split-horizon)Private DNS off, on-premises or peered resolvers not forwarding, clients using regional or custom URLs
Azure private endpointMicrosoft states public DNS settings do not work; the FQDN must resolve to the private IP, often through private DNS zonesZone not linked to every virtual network, custom DNS servers not forwarding, one zone missing for a sub-resource such as file
Google Cloud Private Google AccessCustom DNS zones mapping *.googleapis.com to the private or restricted VIP, with routes to the VIP range and egress firewall allowsNo route to the VIP, deny-all egress rule without a higher priority allow, regional endpoints ending in rep.googleapis.com, which Google documents under a separate access method

If a NAT path exists, a DNS mistake is invisible because traffic still flows. If no NAT path exists, the same mistake breaks the application, and the quick fix is usually to re-enable public access. Decide in advance: fail closed for sensitive data. The DNS Logging and Detection Guide covers resolver query logging.

Cost: where the money goes

AWS charges a NAT gateway for each hour it is available and each gigabyte it processes, and recommends keeping traffic in the gateway's Availability Zone and using VPC endpoints when most NAT traffic goes to AWS services. Interface endpoints are charged per hour per zone plus per GB; gateway endpoints for Amazon S3 and DynamoDB carry no additional charge. Azure service endpoint policies carry no extra charge beyond service endpoint pricing. Rates change, so check current pricing pages.

  • Heavy object storage traffic: backups, data lakes and image layers. A storage gateway endpoint or Private Google Access removes the NAT processing charge and adds a policy point: cheaper and more secure.
  • Many low-volume services: one interface endpoint per service per zone adds hourly cost in every VPC; centralising endpoints in a shared services network reduces the count but enlarges the blast radius of a mistake.
  • Cost as a signal: a jump in NAT bytes processed is also an exfiltration indicator; see Cloud Cost Anomalies as Security Signals.

When to use each, and trade-offs

Traffic flowPreferred pathWhy
Workload to provider object storage, secrets, keys, queues, loggingEndpoint with narrowed policy; resource policy conditioned on the endpointIdentity-aware control, lower cost, no internet dependency
Workload to your own services in another VPC or accountInterface or private endpoint, or Private Service ConnectExposes one service, not a routed network; provider-side approval
Workload to SaaS or third party APIs on the internetNAT gateway behind an egress firewall or proxy with a domain allow listDestination is not a provider service; filtering must be explicit
Operating system and package updatesInternal mirror or package proxy reached privately; NAT with an allow list as fallbackRemoves general internet egress from production subnets
Third party service offered over private connectivityEndpoint, approved like a firewall changePrivate, but still an outbound channel to another organisation
Isolated or regulated workloadsEndpoints only, no NAT route at allEvery external dependency is named, reviewed and logged

Small organisations get most of the benefit from free storage gateway endpoints, a NAT gateway per zone and an egress firewall. Larger estates usually centralise shared interface endpoints, private DNS and an inspected egress path in a hub, so spokes have no direct NAT route; easier to audit, harder to change. See Cloud Egress Filtering for the NAT side.

Worked scenario: a payments batch workload

A batch job across three zones reads files from object storage, decrypts them with a key service, writes to a queue and calls one external card network API, all through a single NAT gateway.

  1. Map the flows: flow and resolver logs show most NAT bytes go to object storage and only a trickle to the card network.
  2. Move provider traffic to endpoints: add a gateway endpoint for storage and interface endpoints for the key service and queue, each with a policy limited to the organisation's resources and the job's role.
  3. Bind the data to the path: the bucket and key policies now deny requests that do not arrive through the endpoints, so a leaked job credential cannot read the files from elsewhere.
  4. Shrink the NAT path: keep one NAT gateway per zone for the card network only, behind an egress firewall rule allowing that single domain.
  5. Test fail closed: in staging, remove the NAT route and confirm the job still works; anything that breaks is an undeclared dependency.

How to implement: a phased approach

  1. Inventory: list every NAT gateway, endpoint and endpoint policy; flag full access defaults and resources with public access enabled behind a private endpoint.
  2. Measure: enable flow logs on NAT subnets and resolver query logs; rank destinations by bytes and by count of workloads.
  3. Add endpoints in monitor mode: create them with full access, confirm in logs that traffic shifts, and that DNS resolves privately from every client network, including on-premises and peered ones.
  4. Narrow policies: move to organisation-scoped policies one endpoint at a time, pilot account first, watching for access denied errors from managed services.
  5. Bind resources: add resource-side conditions or disable public network access for the most sensitive stores; keep a break-glass role exempted and alerted.
  6. Remove or restrict the NAT path: add an egress firewall with domain allow lists, or remove the default route from subnets that no longer need the internet.
  7. Roll back safely: keep previous policy documents versioned in infrastructure as code and revert them, rather than re-adding a NAT route under pressure.

Where identity fits

Every request through an endpoint is signed by a machine identity: an instance role, managed identity or service account. Endpoint and resource conditions tie those non-human identities to a network location, which stops a stolen workload token being replayed elsewhere. Give each endpoint policy an owner, review it like an IAM role, and alert when a workload identity is used outside its expected endpoint. See the AWS IAM Policies and Roles Guide.

Detection and measurement

  • Flow logs on NAT subnets: bytes per destination and per source workload; alert on new destinations and on volume spikes.
  • Control plane events: changes to endpoints and their policies (on AWS, ModifyVpcEndpoint), private endpoint connection approvals, perimeter changes and public network access toggles.
  • Data access logs with endpoint ID: requests to sensitive stores that did not come through an expected endpoint, or that came through it from an unexpected principal.

Metrics that show the design is working:

  1. Share of provider API bytes leaving through endpoints rather than NAT (target close to 100 per cent).
  2. Number of endpoints still on full access default policies (target zero for data services).
  3. Number of sensitive resources with public network access enabled despite a private endpoint.
  4. Number of production subnets with an unfiltered default route to a NAT gateway.
  5. Monthly NAT bytes processed, trended, with anomalies investigated.

Common failure patterns

  • Endpoint created, policy never narrowed: the route is private, the destination is unrestricted, and an attacker's bucket in the same Region is reachable through it.
  • Private endpoint plus public access: the resource still answers internet requests with a valid key or token, so the endpoint protects nothing against credential theft.
  • One NAT gateway for all zones: AWS documents that a zone failure then removes egress for resources in other zones, and cross-zone charges accrue daily.
  • Provider wildcard allow lists: allowing every storage hostname at a provider through the NAT firewall permits uploads to any tenant.

Framework mapping

FrameworkReferenceHow the egress path decision supports it
NIST SP 800-53 Rev 5SC-7 Boundary Protection; SC-7(5) Deny by Default, Allow by ExceptionEndpoints and filtered NAT make egress an explicit, allow-listed boundary
NIST SP 800-53 Rev 5AC-4 Information Flow EnforcementEndpoint and perimeter policies restrict which resources data may flow to
NIST CSF 2.0PR.IR-01; PR.AA-05; DE.CM-01Network protection, least privilege on endpoint policies, monitoring of network flows
ISO/IEC 27001:2022 Annex AA.8.20 Networks security; A.8.22 Segregation of networksControlled egress paths and segmented service access
MITRE ATT&CK v20T1537; T1567.002; T1048; T1078.004Techniques the endpoint path constrains and the NAT path must filter

Practitioner checklist

  • Every data service reached by workloads has an endpoint, and none carries a full access default policy.
  • Endpoint policies restrict requests to your organisation's resources and, where supported, your principals.
  • Sensitive stores accept requests only through your endpoints, or have public network access disabled.
  • Private DNS resolves service names to endpoint addresses from every client network, tested from each.
  • NAT gateways exist per zone, and only for flows that need the internet.
  • Every NAT path passes through an egress firewall or proxy with a destination allow list.
  • Third party endpoint connections are approved through the same change process as firewall rules.

Standards and references

Related NHI Mgmt Group resources: Cloud Private Connectivity Guide, Private Endpoints vs Public Endpoints for AI Services, Cloud Egress Filtering, Data Exfiltration Guide.

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 14 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.