Azure Firewall

Azure Firewall is a managed, cloud-based network security service that protects your Azure Virtual Network resources. It's a fully stateful firewall as a service with built-in high availability and cloud scalability.

Azure Firewall is a network security service that protects your Azure Virtual Network resources. It's a fully stateful firewall as a service with built-in high availability and cloud scalability. You can use Azure Firewall to centralize your network traffic filtering policies across subscriptions and virtual networks, providing a single pane of glass for network security.

Key Features

Architecture

Azure Firewall is deployed as a network virtual appliance (NVA) within a dedicated subnet named AzureFirewallSubnet. This subnet must have a minimum prefix of /26. The firewall acts as a central inspection point for traffic from various sources, including:

Traffic is routed to the Azure Firewall using User Defined Routes (UDRs) defined on the associated subnets.

Azure Firewall Architecture Diagram

Deployment

You can deploy Azure Firewall using the Azure portal, Azure PowerShell, Azure CLI, or ARM templates.

Steps to Deploy (Azure Portal)

  1. Navigate to the Azure portal.
  2. Search for "Firewall" and select "Firewalls".
  3. Click "Create firewall".
  4. Fill in the required details: Subscription, Resource group, Name, Region, Firewall name, Firewall SKU, and select a Virtual Network.
  5. Create a dedicated subnet named AzureFirewallSubnet with at least a /26 address prefix.
  6. Configure public IP address if needed.
  7. Review and create the firewall.

Rule Management

Azure Firewall uses three types of rules:

Network Rules

Network rules filter traffic based on Layer 3 and Layer 4 information, including:

Example Network Rule: Allow outbound HTTP traffic to a specific IP address.

{
    "ruleType": "NetworkRule",
    "sourceAddresses": [
        "10.0.1.0/24"
    ],
    "destinationAddresses": [
        "203.0.113.5"
    ],
    "protocols": [
        "TCP"
    ],
    "destinationPorts": [
        "80"
    ],
    "name": "Allow-Outbound-HTTP"
}

Application Rules

Application rules filter HTTP and HTTPS traffic based on fully qualified domain names (FQDNs) or FQDN tags. This provides more granular control at Layer 7.

Example Application Rule: Allow access to a specific set of Microsoft update servers.

{
    "ruleType": "ApplicationRule",
    "sourceAddresses": [
        "10.0.1.0/24"
    ],
    "protocols": [
        {
            "protocolType": "Https",
            "port": 443
        }
    ],
    "targetFqdns": [
        "*.windowsupdate.microsoft.com",
        "*.ntp.org"
    ],
    "name": "Allow-Microsoft-Updates"
}

DNAT Rules

DNAT rules translate Destination Network Address Translation (DNAT) to forward traffic destined for a public IP address and port to a private IP address and port within your VNet. This is commonly used for inbound access to services.

Example DNAT Rule: Forward inbound RDP traffic to a specific virtual machine.

{
    "ruleType": "DnatRule",
    "sourceAddresses": [
        "*"
    ],
    "destinationAddresses": [
        "20.1.1.1"  // Public IP of Azure Firewall
    ],
    "protocols": [
        "TCP"
    ],
    "destinationPorts": [
        "3389"
    ],
    "translatedAddress": "10.0.2.4", // Private IP of VM
    "translatedPort": "3389",
    "name": "Allow-RDP-Inbound"
}

Use Cases