Service Endpoint Policies and Access Control
What you'll learn: How to use service endpoint policies to whitelist specific cloud resources and prevent data exfiltration through your private network paths.
The Problem with Unrestricted Endpoints
When you enable service endpoints (from the previous lesson), your VPC gets private network access to cloud services like storage or databases. But here's the catch: by default, traffic can reach any storage account or database in the entire cloud region—even ones owned by other organizations. That's a data exfiltration risk.
Think of it like this: Service endpoints are like giving your office a direct tunnel to a massive warehouse district. Without policies, employees could load trucks and drive to anyone's warehouse, not just yours.
What Service Endpoint Policies Do
Service endpoint policies act as allow-lists that restrict which specific resources can be accessed through your service endpoints. You create a policy that explicitly names the storage accounts, key vaults, or databases your VPC is permitted to reach.
For example, you might configure:
- "Allow access to storage account
prod-data-us-east" - "Block all other storage accounts in the region"
When an attacker compromises a VM, they can't exfiltrate data to their own malicious storage account over your private endpoint—the policy blocks it.
Access Control in Action
These policies typically work at the subnet level. You attach them to specific subnets where service endpoints are enabled. Traffic leaving those subnets gets evaluated: if the destination resource isn't on your allow-list, it's denied—even though the endpoint is active.
This provides defense-in-depth: your network security groups control IP-level access, while service endpoint policies control resource-level access. An attacker needs to compromise both layers.
Key Takeaway: Service endpoint policies transform service endpoints from "access to all resources of this type" into "access only to our specific, approved resources," dramatically reducing data exfiltration risk.