Lesson 1 of 4 Network Traffic Filtering

Understanding Azure Network Security

This lesson explains how traffic moves in a virtual network, and how the Azure network security services fit together.

Learning outcomes

After completing this lesson, you will be able to:

  • Explain segmentation and blast radius.
  • Distinguish routing from filtering.
  • Compare the main network security services.
  • Choose controls for each traffic direction.

The role of the network

Identity decides who can do something, and the network decides what can be reached from where. A Zero Trust design does not treat the network as a trusted zone, but network controls remain essential, because they restrict an attacker's movement. If a compromised web server can reach only one application port, then a database on another subnet is much harder to attack. This is known as segmentation, and it limits the blast radius of a breach.

By default, everything in a virtual network can talk to everything else in it, and that default is the main thing that a security engineer has to change.

How traffic moves in Azure

A virtual network is a private address space divided into subnets. Azure routes traffic between subnets automatically through system routes, and a user-defined route (UDR) overrides them, for instance to send traffic through a firewall. A route decides where a packet goes, and a filter decides whether it is allowed. Many network faults arise from confusing these two. A packet can be allowed by every rule and still never arrive because of a route.

Traffic has three broad directions, and each is addressed by different controls.

  • Inbound from the internet, sometimes called north-south traffic: protected by Azure DDoS Protection, a WAF for web applications, and Azure Firewall.
  • Between workloads, called east-west traffic: protected by NSGs and by Azure Firewall on a route between subnets or spokes.
  • Outbound to the internet: controlled by Azure Firewall or a NAT gateway. Controlling this direction limits data exfiltration and communication with attacker servers.

Outbound access has also changed. For API versions released after 31 March 2026, new virtual networks default to private subnets, which have no default outbound internet access, so workloads must use an explicit method such as a NAT gateway. Existing virtual networks are not changed.

True or false

Routes and filters

Exam skills 2.3.1 · 2.3.9

Check how routing and filtering interact in Azure.

Log in to try this activity Interactive activities are free with an account.

Layering the controls

Each Azure network security service works at a different layer, and the exam expects candidates to choose among them. The following table compares the main services.

ServiceLayer and scopeMain purpose
Network security groupLayers 3 and 4, at a subnet or NICFiltering by address, port and protocol
Azure Virtual Network ManagerLayers 3 and 4, across many networksCentral rules that teams cannot override
Azure FirewallLayers 3 to 7, central in a networkFQDN filtering, threat intelligence and, with Premium, IDPS
Web Application FirewallLayer 7, on a web front endProtection from web attacks such as SQL injection
Azure DDoS ProtectionLayers 3 and 4, on public IP addressesMitigation of volumetric attacks
Private LinkConnectivityPrivate access to PaaS services

A hub-and-spoke design is common. Shared services, including Azure Firewall, sit in a central hub network, and workloads sit in spoke networks that are peered to it. UDRs on the spokes send traffic to the firewall, so that all traffic between spokes and to the internet passes one inspection point. NSGs are still applied in the spokes as a second layer.

The following diagram places the controls in a hub-and-spoke design.

Layered network controls in a hub-and-spoke design. DDoS Protection guards public IP addresses and a Web Application Firewall protects web front ends at layer 7. Azure Firewall sits in the hub network, and user-defined routes on the spokes send traffic between spokes and to the internet through it, so there is one inspection point. Network security groups in the spokes filter by address, port and protocol as a second layer, and Private Link gives private access to PaaS services.
Each service works at a different layer.
Match the pairs

Which network control?

Exam skills 2.3.1 · 2.3.8

Match each network security service with its main purpose.

Log in to try this activity Interactive activities are free with an account.

Service tags and DDoS Protection

A service tag represents the IP address ranges of an Azure service, such as Storage, AzureLoadBalancer or Internet. Microsoft keeps them current, so rules do not need to track address changes. Some tags can be scoped by region, as in Storage.WestEurope.

All Azure public addresses receive basic infrastructure protection against distributed denial of service attacks. Azure DDoS Protection adds tuned mitigation, metrics, alerts and rapid response support, either per public IP address or across a virtual network. Web applications still need a WAF, since DDoS Protection deals with volumetric attacks at layers 3 and 4 and not with application attacks.

Scenario questions

Tags and DDoS

Exam skills 2.3.1

Apply service tags and DDoS Protection correctly.

Log in to try this activity Interactive activities are free with an account.
Worked example

Selecting a control for each path

A three-tier application has a public web tier, an application tier and a database tier. The web tier must be protected from SQL injection. The application tier must accept connections only from the web tier. Outbound traffic from all tiers must go only to approved FQDNs. Which control fits each requirement?

SQL injection is a layer 7 attack, so it needs a Web Application Firewall on Application Gateway or Front Door. Restricting the application tier to the web tier is a layer 4 rule, so it fits an NSG with application security groups. FQDN-based outbound filtering needs Azure Firewall with a UDR that sends outbound traffic through it, because NSGs cannot filter by FQDN.

A single control cannot do all of this, and it would be a mistake to look for one. Azure DDoS Protection addresses none of these three requirements.

Check yourself

Can an NSG allow traffic to www.contoso.com only?

Show answer

No. NSGs work on addresses and ports. FQDN filtering needs Azure Firewall.

Exam Tips

Remember for the exam

  • Routes decide where a packet goes; rules decide whether it is allowed.
  • NSGs cannot filter on FQDN; Azure Firewall can.
  • DDoS Protection does not stop application attacks.
  • Hub-and-spoke designs use UDRs to force traffic through a firewall.