This blog explains how to secure a Virtual network in Azure with Firewall Projection.
Azure Firewall is a cloud-native and intelligent network firewall security service that provides the best of breed threat protection for your cloud workloads running in Azure. It's a fully stateful firewall as a service with built-in high availability and unrestricted cloud scalability. It provides both east-west and north-south traffic inspection.
In this demonstration we will create a single Virtual network with two subnets
- Virtual Network Name: Infrabeast_testvNet
- Network 10.0.0.0/16.
- Subnet 1 AzureFirewallSubnet
- Subnet Range 10.0.0.128/26
- Subnet 2 dataSubnet01
- Subnet Range 10.0.0.0/25
- Setup the network using Terraform.
- Deploy a virtual machine in the Data subnet.
- Deploy Azure Firewall and Policy
- Create a default, Route.
- Configure an application rule to allow access to www.google.com.
- Configure a network rule to allow access to external DNS servers.
- Configure a NAT rule to allow a remote desktop to the test server.
- Test the Firewall Policy
- Resource Group
- Virtual Network and subnets
- Public IP for Firewall
- IP Group for dataSubnet01
- Firewall Policies (Application policy, Network Policy)
- Azure Firewall Instance
- From Azure portal search for Route tables
- Select Create, then enter or select the following values:
- Subscription Select your Azure subscription.
- Resource group Select Test-FW-RG.
- Region Select the same location that you used previously.
- Name DefaultRoute
- Select Review + create.
- Select Create.
- Wait for the deployment to complete
- Go to resource.
- On the Firewall-route page, select Subnets and then select Associate.
- Select Virtual network > dataSubnet01
- Select OK.
- Select Routes and then select Add.
- For Route name, enter fw-dg.
- For Address prefix, enter 0.0.0.0/0.
- For Next hop type, select Virtual appliance.
- For Next hop address, enter the private IP address for the firewall.
- Select OK
Once the infrastructure has configured let's create a VM in the data subnet to test the firewall policies. A Windows server VM is created withe below configuration.
Resource group infra-test-rg01Virtual machine name Data-SRV-01Region eastusUsername *******Password *******Network Infrabeast-testv-NetSubnet subnet-serverPublic IP NON
Step 4 Configure a NAT rule to allow a remote desktop to the test server.
This rule allows you to connect a remote desktop to the virtual machine through the firewall.
- Select the DNAT rules.
- Select Add a rule collection.
- For Name, RDP Redirect.
- For Priority, enter 200.
- For Rule collection group, select DefaultDnatRuleCollectionGroup.
- Under Rules, for Name, enter DataVM
- For Source type, select IP address.
- For Source, enter *.
- For Protocol, select TCP.
- For Destination Ports, enter 3389.
- For Destination Type, select IP Address.
- For Destination, enter the firewall public IP address.
- For Translated address, enter the Srv-work private IP address.
- For Translated port, enter 3389.
- Select Add.
Step 4 Test the Firewall Policy
Now we can test the firewall to confirm it works as expected
- Connect a remote desktop to firewall public IP address and this should take you the Virtual machine in dataSubnet01
- Open Internet Explorer and browse to https://www.google.com, You should get the google page displayed.
- Browse to https://www.youtube.com. this will be blocked by firewall.