Tutorial: Secure your virtual hub using Azure Firewall Manager

Using Azure Firewall Manager, you can create secured virtual hubs to secure your cloud network traffic destined to private IP addresses, Azure PaaS, and the Internet. Traffic routing to the firewall is automated, so there's no need to create user defined routes (UDRs).

secure the cloud network

Firewall Manager also supports a hub virtual network architecture. For a comparison of the secured virtual hub and hub virtual network architecture types, see What are the Azure Firewall Manager architecture options?

In this tutorial, you learn how to:

  • Create the spoke virtual network
  • Create a secured virtual hub
  • Connect the hub and spoke virtual networks
  • Route traffic to your hub
  • Deploy the servers
  • Create a firewall policy and secure your hub
  • Test the firewall

Prerequisites

If you don't have an Azure subscription, create a free account before you begin.

Create a hub and spoke architecture

First, create spoke virtual networks where you can place your servers.

Create two spoke virtual networks and subnets

The two virtual networks will each have a workload server in them and will be protected by the firewall.

  1. From the Azure portal home page, select Create a resource.
  2. Under Networking, select Virtual network.
  3. For Subscription, select your subscription.
  4. For Resource group, select Create new, and type fw-manager for the name and select OK.
  5. For Name, type Spoke-01.
  6. For Region, select (US) East US.
  7. Select Next: IP Addresses.
  8. For Address space, type 10.1.0.0/16.
  9. Select Add subnet.
  10. Type Workload-01-SN.
  11. For Subnet address range, type 10.1.1.0/24.
  12. Select Add.
  13. Select Review + create.
  14. Select Create.

Repeat this procedure to create another similar virtual network:

Name: Spoke-02
Address space: 10.2.0.0/16
Subnet name: Workload-02-SN
Subnet address range: 10.2.1.0/24

Create the secured virtual hub

Create your secured virtual hub using Firewall Manager.

  1. From the Azure portal home page, select All services.
  2. In the search box, type Firewall Manager and select Firewall Manager.
  3. On the Firewall Manager page, select View secured virtual hubs.
  4. On the Firewall Manager | Secured virtual hubs page, select Create new secured virtual hub.
  5. For Resource group, select fw-manager.
  6. For Region, select East US.
  7. For the Secured virtual hub name, type Hub-01.
  8. For Hub address space, type 10.0.0.0/16.
  9. For the new vWAN name, type Vwan-01.
  10. Leave the Include VPN gateway to enable Trusted Security Partners check box cleared.
  11. Select Next: Azure Firewall.
  12. Accept the default Azure Firewall Enabled setting and then select Next: Trusted Security Partner.
  13. Accept the default Trusted Security Partner Disabled setting, and select Next: Review + create.
  14. Select Create. It will take about 30 minutes to deploy.

Now you can get the firewall public IP address.

  1. After the deployment is complete, on the Azure portal select All services.
  2. Type firewall manager and then select Firewall Manager.
  3. Select Secured virtual hubs.
  4. Select hub-01.
  5. Select Public IP configuration.
  6. Note the public IP address to use later.

Connect the hub and spoke virtual networks

Now you can peer the hub and spoke virtual networks.

  1. Select the fw-manager resource group, then select the Vwan-01 virtual WAN.
  2. Under Connectivity, select Virtual network connections.
  3. Select Add connection.
  4. For Connection name, type hub-spoke-01.
  5. For Hubs, select Hub-01.
  6. For Resource group, select fw-manager.
  7. For Virtual network, select Spoke-01.
  8. Select Create.

Repeat to connect the Spoke-02 virtual network: connection name - hub-spoke-02

Deploy the servers

  1. On the Azure portal, select Create a resource.

  2. Select Windows Server 2016 Datacenter in the Popular list.

  3. Enter these values for the virtual machine:

    Setting Value
    Resource group fw-manager
    Virtual machine name Srv-workload-01
    Region (US) East US)
    Administrator user name type a user name
    Password type a password
  4. Under Inbound port rules, for Public inbound ports, select None.

  5. Accept the other defaults and select Next: Disks.

  6. Accept the disk defaults and select Next: Networking.

  7. Select Spoke-01 for the virtual network and select Workload-01-SN for the subnet.

  8. For Public IP, select None.

  9. Accept the other defaults and select Next: Management.

  10. Select Off to disable boot diagnostics. Accept the other defaults and select Review + create.

  11. Review the settings on the summary page, and then select Create.

Use the information in the following table to configure another virtual machine named Srv-Workload-02. The rest of the configuration is the same as the Srv-workload-01 virtual machine.

Setting Value
Virtual network Spoke-02
Subnet Workload-02-SN

After the servers are deployed, select a server resource, and in Networking note the private IP address for each server.

Create a firewall policy and secure your hub

A firewall policy defines collections of rules to direct traffic on one or more Secured virtual hubs. You'll create your firewall policy and then secure your hub.

  1. From Firewall Manager, select View Azure Firewall policies.
  2. Select Create Azure Firewall Policy.
  3. Under Policy details, for the Name type Policy-01 and for Region select East US.
  4. Select Next: DNS Settings (preview).
  5. Select Next: Rules.
  6. On the Rules tab, select Add a rule collection.
  7. On the Add a rule collection page, type App-RC-01 for the Name.
  8. For Rule collection type, select Application.
  9. For Priority, type 100.
  10. Ensure Rule collection action is Allow.
  11. For the rule Name type Allow-msft.
  12. For the Source type, select IP address.
  13. For Source, type *.
  14. For Protocol, type http,https.
  15. Ensure Destination type is FQDN.
  16. For Destination, type *.microsoft.com.
  17. Select Add.

Add a DNAT rule so you can connect a remote desktop to the Srv-Workload-01 virtual machine.

  1. Select Add a rule collection.
  2. For Name, type DNAT-rdp.
  3. For Rule collection type, select DNAT.
  4. For Priority, type 100.
  5. For the rule Name type Allow-rdp.
  6. For the Source type, select IP address.
  7. For Source, type *.
  8. For Protocol, select TCP.
  9. For Destination Ports, type 3389.
  10. For Destination Type, select IP Address.
  11. For Destination, type the firewall public IP address that you noted previously.
  12. For Translated address, type the private IP address for Srv-Workload-01 that you noted previously.
  13. For Translated port, type 3389.
  14. Select Add.

Add a network rule so you can connect a remote desktop from Srv-Workload-01 to Srv-Workload-02.

  1. Select Add a rule collection.
  2. For Name, type vnet-rdp.
  3. For Rule collection type, select Network.
  4. For Priority, type 100.
  5. For the rule Name type Allow-vnet.
  6. For the Source type, select IP address.
  7. For Source, type *.
  8. For Protocol, select TCP.
  9. For Destination Ports, type 3389.
  10. For Destination Type, select IP Address.
  11. For Destination, type the Srv-Workload-02 private IP address that you noted previously.
  12. Select Add.
  13. Select Next: Threat intelligence.
  14. Select Next: Hubs.
  15. On the Hubs tab, select Associate virtual hubs.
  16. Select Hub-01 and then select Add.
  17. Select Review + create.
  18. Select Create.

This can take about five minutes or more to complete.

Route traffic to your hub

Now you must ensure that network traffic gets routed through your firewall.

  1. From Firewall Manager, select Secured virtual hubs.
  2. Select Hub-01.
  3. Under Settings, select Security configuration.
  4. Under Internet traffic, select Azure Firewall.
  5. Under Private traffic, select Send via Azure Firewall.
  6. Verify that the hub-spoke connection shows Internet Traffic as Secured.
  7. Select Save.

Test your firewall

To test your firewall rules, you'll connect a remote desktop using the firewall public IP address, which is NATed to Srv-Workload-01. From there you'll use a browser to test the application rule and connect a remote desktop to Srv-Workload-02 to test the network rule.

Test the application rule

Now, test the firewall rules to confirm that it works as expected.

  1. Connect a remote desktop to firewall public IP address, and sign in.

  2. Open Internet Explorer and browse to https://www.microsoft.com.

  3. Select OK > Close on the Internet Explorer security alerts.

    You should see the Microsoft home page.

  4. Browse to https://www.google.com.

    You should be blocked by the firewall.

So now you've verified that the firewall application rule is working:

  • You can browse to the one allowed FQDN, but not to any others.

Test the network rule

Now test the network rule.

  • Open a remote desktop to the Srv-Workload-02 private IP address.

    A remote desktop should connect to Srv-Workload-02.

So now you've verified that the firewall network rule is working:

  • You can connect a remote desktop to a server located in another virtual network.

Clean up resources

When you are done testing your firewall resources, delete the fw-manager resource group to delete all firewall-related resources.

Next steps