Private Endpoints Are Only Secure When Configured Completely
Azure Private Endpoints bring Azure PaaS services into your virtual network via private IP addresses. However, creating a private endpoint is only the first step. Without disabling public access, configuring DNS correctly, and monitoring traffic, your “private” services may still be reachable from the internet. This guide covers how to implement private endpoints properly.
Threat Landscape and Attack Surface
Hardening Azure Private Endpoints requires understanding the threat landscape specific to this service. Azure services are attractive targets because they often store, process, or transmit sensitive data and provide control-plane access to cloud infrastructure. Attackers probe for misconfigured services using automated scanners that continuously sweep Azure IP ranges for exposed endpoints, weak authentication, and default configurations.
The attack surface for Azure Private Endpoints includes several dimensions. The network perimeter determines who can reach the service endpoints. The identity and access layer controls what authenticated principals can do. The data plane governs how data is protected at rest and in transit. The management plane controls who can modify the service configuration itself. A comprehensive hardening strategy addresses all four dimensions because a weakness in any single layer can be exploited to bypass the controls in other layers.
Microsoft’s shared responsibility model means that while Azure secures the physical infrastructure, network fabric, and hypervisor, you are responsible for configuring the service securely. Default configurations prioritize ease of setup over security. Every Azure service ships with settings that must be tightened for production use, and this guide walks through the critical configurations that should be changed from their defaults.
The MITRE ATT&CK framework for cloud environments provides a structured taxonomy of attack techniques that adversaries use against Azure services. Common techniques relevant to Azure Private Endpoints include initial access through exposed credentials or misconfigured endpoints, lateral movement through overly permissive RBAC assignments, and data exfiltration through unmonitored data plane operations. Each hardening control in this guide maps to one or more of these attack techniques.
Compliance and Regulatory Context
Security hardening is not just a technical exercise. It is a compliance requirement for virtually every regulatory framework that applies to cloud workloads. SOC 2 Type II requires evidence of security controls for cloud services. PCI DSS mandates network segmentation and encryption for payment data. HIPAA requires access controls and audit logging for health information. ISO 27001 demands a systematic approach to information security management. FedRAMP requires specific configurations for government workloads.
Azure Policy and Microsoft Defender for Cloud provide built-in compliance assessments against these frameworks. After applying the hardening configurations in this guide, run a compliance scan to verify your security posture against your applicable regulatory standards. Address any remaining findings to achieve and maintain compliance. Export compliance reports on a scheduled basis to satisfy audit requirements and demonstrate continuous adherence.
The Microsoft cloud security benchmark provides a comprehensive set of security controls mapped to common regulatory frameworks. Use this benchmark as a checklist to verify that your hardening effort covers all required areas. Each control includes Azure-specific implementation guidance and links to the relevant Azure service documentation.
Step 1: Create Private Endpoints with Private DNS Zones
# Create private DNS zone for the service type
az network private-dns zone create \
--resource-group rg-network --name privatelink.blob.core.windows.net
# Link DNS zone to VNet
az network private-dns zone vnet-link create \
--resource-group rg-network --zone-name privatelink.blob.core.windows.net \
--name link-vnet-prod --virtual-network vnet-prod --registration-enabled false
# Create private endpoint
az network private-endpoint create \
--name pe-storage --resource-group rg-network \
--vnet-name vnet-prod --subnet snet-pe \
--private-connection-resource-id "/subscriptions/{sub}/resourceGroups/rg-data/providers/Microsoft.Storage/storageAccounts/stprod" \
--group-id blob --connection-name storage-blob-conn
# Create DNS record in private DNS zone
az network private-endpoint dns-zone-group create \
--resource-group rg-network --endpoint-name pe-storage \
--name default --private-dns-zone "/subscriptions/{sub}/resourceGroups/rg-network/providers/Microsoft.Network/privateDnsZones/privatelink.blob.core.windows.net" \
--zone-name privatelink-blob
Step 2: Always Disable Public Access After Creating Private Endpoints
# Disable public access on storage account
az storage account update --name stprod --resource-group rg-data \
--public-network-access Disabled
# Disable public access on SQL server
az sql server update --name sql-prod --resource-group rg-data \
--enable-public-network false
# Disable public access on Key Vault
az keyvault update --name kv-prod --public-network-access Disabled
# Disable public access on Cosmos DB
az cosmosdb update --name cosmos-prod --resource-group rg-data \
--enable-public-network false
Creating a private endpoint does NOT automatically disable public access. The service remains accessible from the internet until you explicitly disable public access. This is the most common mistake with private endpoints.
Step 3: Configure DNS Resolution Correctly
| Service | Private DNS Zone Name |
|---|---|
| Blob Storage | privatelink.blob.core.windows.net |
| SQL Database | privatelink.database.windows.net |
| Key Vault | privatelink.vaultcore.azure.net |
| Cosmos DB (SQL) | privatelink.documents.azure.com |
| ACR | privatelink.azurecr.io |
| App Service | privatelink.azurewebsites.net |
| Event Hub | privatelink.servicebus.windows.net |
| Service Bus | privatelink.servicebus.windows.net |
# Verify DNS resolution (should return private IP)
nslookup stprod.blob.core.windows.net
# Expected: stprod.privatelink.blob.core.windows.net -> 10.0.1.5
# If it returns a public IP, DNS is not configured correctly
Step 4: Use Network Security Groups on Private Endpoint Subnets
# Enable NSG support for private endpoints (not enabled by default)
az network vnet subnet update \
--resource-group rg-network --vnet-name vnet-prod --name snet-pe \
--disable-private-endpoint-network-policies false
# Create NSG with restrictive rules
az network nsg create --name nsg-pe --resource-group rg-network
az network nsg rule create --nsg-name nsg-pe --resource-group rg-network \
--name AllowAppSubnet --priority 100 --direction Inbound \
--source-address-prefixes 10.0.2.0/24 --destination-port-ranges 443 \
--protocol Tcp --access Allow
az network nsg rule create --nsg-name nsg-pe --resource-group rg-network \
--name DenyAll --priority 4096 --direction Inbound \
--source-address-prefixes '*' --destination-port-ranges '*' \
--protocol '*' --access Deny
az network vnet subnet update \
--resource-group rg-network --vnet-name vnet-prod --name snet-pe \
--network-security-group nsg-pe
Step 5: Design the Subnet Layout
- Use a dedicated subnet for private endpoints — do not mix with application workloads
- Size the subnet for growth:
/24provides 251 usable IPs (one per private endpoint) - Use multiple subnets for different security zones (data, management, monitoring)
- Apply NSGs per subnet for east-west traffic control
Identity and Access Management Deep Dive
Identity is the primary security perimeter in cloud environments. For Azure Private Endpoints, implement a robust identity and access management strategy that follows the principle of least privilege.
Managed Identities: Use system-assigned or user-assigned managed identities for service-to-service authentication. Managed identities eliminate the need for stored credentials (connection strings, API keys, or service principal secrets) that can be leaked, stolen, or forgotten in configuration files. Azure automatically rotates the underlying certificates, removing the operational burden of credential rotation.
Custom RBAC Roles: When built-in roles grant more permissions than required, create custom roles that include only the specific actions needed. For example, if a monitoring service only needs to read metrics and logs from Azure Private Endpoints, create a custom role with only the Microsoft.Insights/metrics/read and Microsoft.Insights/logs/read actions rather than assigning the broader Reader or Contributor roles.
Conditional Access: For human administrators accessing Azure Private Endpoints through the portal or CLI, enforce Conditional Access policies that require multi-factor authentication, compliant devices, and approved locations. Set session lifetime limits so that administrative sessions expire after a reasonable period, forcing re-authentication.
Just-In-Time Access: Use Azure AD Privileged Identity Management (PIM) to provide time-limited, approval-required elevation for administrative actions. Instead of permanently assigning Contributor or Owner roles, require administrators to activate their role assignment for a specific duration with a business justification. This reduces the window of exposure if an administrator’s account is compromised.
Service Principal Hygiene: If managed identities cannot be used (for example, for external services or CI/CD pipelines), use certificate-based authentication for service principals rather than client secrets. Certificates are harder to accidentally expose than text secrets, and Azure Key Vault can automate their rotation. Set short expiration periods for any client secrets and monitor for secrets that are approaching expiration.
Step 6: Handle Cross-Region and Cross-Subscription Scenarios
# Private endpoints can be in a different subscription/region from the resource
az network private-endpoint create \
--name pe-remote-storage --resource-group rg-network \
--vnet-name vnet-prod --subnet snet-pe \
--private-connection-resource-id "/subscriptions/{other-sub}/resourceGroups/rg-shared/providers/Microsoft.Storage/storageAccounts/stshared" \
--group-id blob --connection-name cross-sub-storage \
--request-message "Approved by security team"
Cross-subscription private endpoints require approval from the resource owner. The connection stays in Pending state until approved.
Step 7: Automate with Azure Policy
# Deny storage accounts without private endpoints
az policy assignment create \
--name require-pe-storage \
--display-name "Storage accounts must use private endpoints" \
--policy "6edd7eda-6dd8-40f7-810d-67160c639cd9" \
--scope "/subscriptions/{sub}" \
--enforcement-mode Default
Key policies for private endpoints:
- Storage accounts should use private link
- Azure SQL Database should have private endpoint
- Key Vault should use private link
- Cosmos DB should use private link
Step 8: Monitor Private Endpoint Traffic
# Enable NSG flow logs for the PE subnet
az network watcher flow-log create \
--name pe-flow-log --resource-group rg-network \
--nsg nsg-pe --storage-account stflowlogs \
--workspace law-prod-id --enabled true \
--traffic-analytics true
Step 9: Handle Hybrid Connectivity
- On-premises clients: Configure DNS forwarding from on-prem DNS to Azure Private DNS Resolver
- VPN clients: Ensure split tunneling sends privatelink traffic through the VPN
- Hub-spoke topology: Centralize private DNS zones in the hub, link to all spoke VNets
# Create DNS Private Resolver
az dns-resolver create --name dnspr-hub --resource-group rg-network \
--location eastus --id "/subscriptions/{sub}/resourceGroups/rg-network/providers/Microsoft.Network/virtualNetworks/vnet-hub"
Step 10: Audit and Verify
# List all private endpoints in subscription
az network private-endpoint list --query "[].{Name:name, Status:privateLinkServiceConnections[0].privateLinkServiceConnectionState.status, Resource:privateLinkServiceConnections[0].privateLinkServiceId}" -o table
# Find resources with public access still enabled
az storage account list --query "[?networkRuleSet.defaultAction=='Allow'].{Name:name, PublicAccess:'ENABLED'}" -o table
Defense in Depth Strategy
No single security control is sufficient. Apply a defense-in-depth strategy that layers multiple controls so that the failure of any single layer does not expose the service to attack. For Azure Private Endpoints, this means combining network isolation, identity verification, encryption, monitoring, and incident response capabilities.
At the network layer, restrict access to only the networks that legitimately need to reach the service. Use Private Endpoints to eliminate public internet exposure entirely. Where public access is required, use IP allowlists, service tags, and Web Application Firewall (WAF) rules to limit the attack surface. Configure network security groups (NSGs) with deny-by-default rules and explicit allow rules only for required traffic flows.
At the identity layer, enforce least-privilege access using Azure RBAC with custom roles when built-in roles are too broad. Use Managed Identities for service-to-service authentication to eliminate stored credentials. Enable Conditional Access policies to require multi-factor authentication and compliant devices for administrative access.
At the data layer, enable encryption at rest using customer-managed keys (CMK) in Azure Key Vault when the default Microsoft-managed keys do not meet your compliance requirements. Enforce TLS 1.2 or higher for data in transit. Enable purge protection on any service that supports soft delete to prevent malicious or accidental data destruction.
At the monitoring layer, enable diagnostic logging and route logs to a centralized Log Analytics workspace. Configure Microsoft Sentinel analytics rules to detect suspicious access patterns, privilege escalation attempts, and data exfiltration indicators. Set up automated response playbooks that can isolate compromised resources without human intervention during off-hours.
Continuous Security Assessment
Security hardening is not a one-time activity. Azure services evolve continuously, introducing new features, deprecating old configurations, and changing default behaviors. Schedule quarterly security reviews to reassess your hardening posture against the latest Microsoft security baselines.
Use Microsoft Defender for Cloud’s Secure Score as a quantitative measure of your security posture. Track your score over time and investigate any score decreases, which may indicate configuration drift or new recommendations from updated security baselines. Set a target Secure Score and hold teams accountable for maintaining it.
Subscribe to Azure update announcements and security advisories to stay informed about changes that affect your security controls. When Microsoft introduces a new security feature or changes a default behavior, assess the impact on your environment and update your hardening configuration accordingly. Automate this assessment where possible using Azure Policy to continuously evaluate your resources against your security standards.
Conduct periodic penetration testing against your Azure environment. Azure’s penetration testing rules of engagement allow testing without prior notification to Microsoft for most services. Engage a qualified security testing firm to assess your Azure Private Endpoints deployment using the same techniques that real attackers would employ. The findings from these tests often reveal gaps that automated compliance scans miss.
Hardening Checklist
- Private endpoints created with DNS zone groups
- Public access disabled on all PE-enabled resources
- Private DNS zones correctly configured and linked
- NSG enabled and configured on PE subnets
- Dedicated subnets for private endpoints
- Cross-subscription connections properly approved
- Azure Policy enforcing private endpoint requirements
- NSG flow logs and traffic monitoring
- Hybrid DNS resolution configured
- Regular audit of public access status
For more details, refer to the official documentation: What is a private endpoint?, What is Azure Private Link?, Azure Private Endpoint DNS integration.