A retail corporation is setting up an application environment in Azure. The architecture consists of Azure Virtual Machines deployed in a subnet named AppSubnet inside a virtual network named ProductionVNet. The virtual machines must securely access a single Azure SQL Database instance without exposing the traffic to the public internet. You have provisioned a private endpoint for the database in AppSubnet. You now need to restrict traffic from AppSubnet so that the virtual machines can connect only to the private endpoint of that specific SQL database, and prevent outbound access to any other Azure SQL Databases or public endpoints. Which configuration should you apply to the Network Security Group (NSG) linked to AppSubnet?
- Set the private endpoint network policies to Enabled on AppSubnet. Add an outbound rule to the NSG that allows traffic to the private IP address of the private endpoint, followed by a rule with a lower priority that blocks traffic to the Sql service tag.Cevap
- BAdd an outbound rule to the NSG that allows traffic to the Sql service tag, which will automatically route all SQL database requests to the private endpoint.
- CCreate a User Defined Route (UDR) on AppSubnet that redirects all traffic destined for the Sql service tag to the private endpoint's IP address as the next hop.
- DAdd an outbound rule to the NSG that allows traffic to a custom service tag defined specifically for the private endpoint, and create another rule to block the Internet service tag.
Cevap
Set the private endpoint network policies to Enabled on AppSubnet, allow traffic to the private IP address of the private endpoint in the NSG, and block traffic to the Sql service tag with a lower priority rule.
To apply Network Security Group rules to private endpoints, you must first enable private endpoint network policies on the subnet. Once enabled, you can control traffic to the private endpoint using its private IP address. To prevent access to other Azure SQL Databases over their public endpoints, you block the Sql service tag. Because NSG rules are processed in priority order, the specific allow rule for the private endpoint's IP address will be processed first, and any other traffic to Azure SQL public endpoints will be blocked by the Sql service tag rule.
Adım Adım Çözüm
Anahtar Kavram
Applying Network Security Group (NSG) rules to Private Endpoints using network policies