Study guide

5.1 Virtual Network Security & Micro-segmentation

Microsoft Azure Security Technologies AZ-500

Track your progress as you read

Finished sections get a check mark.

1 Chapter 1: Exam Overview & Azure Security Architecture Foundation

1.1 Azure Security Engineer Role & Exam Logistics 1.2 Microsoft Cybersecurity Reference Architecture & Zero Trust Principles

2 Chapter 2: Secure Identity and Access - Authentication, MFA & PIM

2.1 Microsoft Entra ID Security, Users, and Groups 2.2 Authentication Methods, MFA, and Conditional Access Policy Design 2.3 Microsoft Entra Privileged Identity Management (PIM)

3 Chapter 3: Secure Identity and Access - RBAC & Workload Identity

3.1 Azure RBAC, Custom Roles, and Governance 3.2 Workload Identities and Managed Identities 3.3 External Identities and Cross-Tenant Collaboration

4 Chapter 4: Microsoft Entra Application Access & Consent Governance

4.1 Enterprise Applications, OAuth Permission Grants & Consent Governance 4.2 App Registrations, Permission Scopes & Service Principal Credentials

5 Chapter 5: Secure Azure Networking - Boundary & Perimeter Protection

5.1 Virtual Network Security & Micro-segmentation 5.2 Azure Firewall and Firewall Manager 5.3 Web Application Firewall (WAF) & Azure Front Door

6 Chapter 6: Secure Azure Networking - Private Access & Monitoring

6.1 Private Connectivity with Private Endpoints & Private Link 6.2 Azure Bastion & Remote Management Security 6.3 Network Perimeter Protection & Flow Monitoring

7 Chapter 7: Network Architecture, Routing & Hybrid Connectivity

7.1 Azure Virtual Network Manager, Network Groups & User-Defined Routes 7.2 VPN Gateway, ExpressRoute Encryption & Virtual WAN Secured Hub 7.3 Network Integration for App Service, Functions, App Service Environment & SQL Managed Instance

8 Chapter 8: Public and Edge Access Protection

8.1 Azure Application Gateway Security, TLS Policy & Mutual Authentication 8.2 Azure Front Door, CDN Caching & TLS for App Service and API Management

9 Chapter 9: Compute, Container & Registry Security

9.1 Azure Virtual Machine Hardening & Host Security 9.2 Azure Key Vault Deep Dive & Secrets Lifecycle 9.3 Container & Azure Kubernetes Service (AKS) Security 9.4 Azure Container Instances, Container Apps & Registry Access Control

10 Chapter 10: Storage Security, Access Methods & Data Protection

10.1 Storage Account Security & Access Controls 10.2 Selecting and Configuring Access to Azure Files 10.3 Selecting and Configuring Access to Azure Blob Storage 10.4 Storage Data Protection: Soft Delete, Versioning, Point-in-Time Restore & Backup

11 Chapter 11: Data Platform & Database Security

11.1 Azure SQL Database Security & Always Encrypted 11.2 Database Auditing & Vulnerability Assessment 11.3 Data Discovery, Classification, & Microsoft Purview Integration

12 Chapter 12: Cloud Governance, Key Lifecycle & Asset Protection

12.1 Azure Policy for Security Governance: Definitions, Initiatives, Effects & Remediation 12.2 Key Vault Backup, Recovery & Automated Key Rotation 12.3 Implementing Security Controls to Protect Backups 12.4 Security Controls for Asset Management: Locks, Tags, Resource Graph & Azure Arc

13 Chapter 13: Microsoft Defender for Cloud - Posture & Workload Protection

13.1 Microsoft Defender for Cloud & Secure Score 13.2 Defender Cloud Workload Protection (CWP) Plans 13.3 Defender for Cloud Inventory, Compliance Standards & Custom Standards 13.4 Connecting AWS and GCP Environments to Microsoft Defender for Cloud

14 Chapter 14: External Attack Surface & Vulnerability Management

14.1 Microsoft Defender External Attack Surface Management (EASM) 14.2 Agentless Scanning & Microsoft Defender Vulnerability Management for Azure VMs 14.3 Defender for Cloud DevOps Security: GitHub, Azure DevOps & GitLab

15 Chapter 15: Security Monitoring, Microsoft Sentinel & Automation

15.1 Azure Monitor Data Collection Rules & Network Security Event Monitoring 15.2 Microsoft Sentinel Data Connectors, Content Hub & Normalization 15.3 Microsoft Sentinel Workspace & KQL Threat Hunting 15.4 Sentinel Incident Management & SOAR Automation

5.1 Virtual Network Security & Micro-segmentation

Key Takeaways Explain This Topic AI

Virtual Network (VNet) design baselines establish non-overlapping CIDR blocks and enforce dedicated subnets for core security gateways (AzureFirewallSubnet, GatewaySubnet, AzureBastionSubnet).

Network Security Groups (NSGs) perform stateful Layer 3/4 packet filtering evaluated by priority numbers (100 to 4096), terminating evaluation on the first matching rule.

Application Security Groups (ASGs) group virtual machine network interfaces logically to enable zero-trust micro-segmentation without explicit IP management overhead.

Service Endpoints extend VNet private address spaces to Azure PaaS services over the Microsoft backbone, enhanced by Service Endpoint Policies to prevent data exfiltration.

VNet Peering connects networks with encryption over Microsoft's backbone, requiring explicit security flag configurations (Allow Forwarded Traffic, Gateway Transit) to prevent unauthorized transitive routing.

Last updated: August 2026

4.1 Virtual Network Security & Micro-segmentation

In Microsoft Azure, the Virtual Network (VNet) forms the fundamental private network boundary for cloud workloads. A robust security strategy requires designing isolated subnets, enforcing stateful traffic inspection via Network Security Groups (NSGs), implementing workload-centric micro-segmentation with Application Security Groups (ASGs), securing PaaS traffic through Service Endpoints, and strictly governing inter-VNet routing.

Azure Virtual Network (VNet) Design Baselines

A secure VNet deployment begins with structured IP address space allocation and subnet segregation according to workload security tiers:

1. Non-Overlapping CIDR Spaces

When designing VNets, allocate non-overlapping IPv4/IPv6 CIDR blocks (e.g., 10.100.0.0/16 ) across all cloud regions and on-premises sites connected via VPN or ExpressRoute. Overlapping address spaces break IP routing and create complex NAT requirements.

2. Dedicated Gateway & Management Subnets

Azure reserves specific subnets with precise naming conventions for native infrastructure services:

AzureFirewallSubnet : Reserved exclusively for Azure Firewall instances. Requires a minimum subnet size of /26 ( /24 recommended for operational scaling). Cannot have NSGs attached.

GatewaySubnet : Dedicated to Azure Virtual Network Gateways (VPN or ExpressRoute). Requires at least /27 ( /26 recommended).

AzureBastionSubnet : Reserved for Azure Bastion host provisioning. Minimum /26 subnet required.

RouteServerSubnet : Dedicated to Azure Route Server BGP peering.

3. Tiered Workload Isolation

Subnets should segment workloads by risk profile and data sensitivity (e.g., Web-Tier-Subnet ( 10.100.1.0/24 ), App-Tier-Subnet ( 10.100.2.0/24 ), Data-Tier-Subnet ( 10.100.3.0/24 )). Direct internet inbound access should be denied by default on all internal tiers.

Network Security Groups (NSGs) & Stateful Filtering

A Network Security Group (NSG) contains stateful access control rules that allow or deny inbound or outbound network traffic. NSGs can be linked to subnets, individual Network Interfaces (NICs), or both.

Stateful Inspection Behavior

NSGs are stateful . If an inbound rule permits traffic (e.g., HTTP on port 80), the NSG automatically allows return outbound response traffic for that connection, regardless of outbound rules. Similarly, allowed outbound connections automatically permit return inbound responses.

Rule Priorities & Evaluation Mechanics

Priority integers range from 100 to 4096 .

Rules are processed in sequential order from lowest priority number to highest .

Evaluation stops as soon as a rule matches the connection parameters (Source IP/ASG, Source Port, Destination IP/ASG, Destination Port, Protocol). Sub-sequential rules are ignored.

Default Inbound & Outbound Rules

Every NSG contains non-modifiable default rules with priorities starting at 65000 :

Rule Name Priority Direction Source Destination Protocol Access Intent & Description

AllowVNetInBound 65000 Inbound VirtualNetwork VirtualNetwork Any Allow Permits intra-VNet and peered VNet communication.

AllowAzureLoadBalancerInBound 65001 Inbound AzureLoadBalancer Any Any Allow Permits health probes from Azure load balancers.

DenyAllInBound 65500 Inbound Any Any Any Deny Default drop for all unmatched inbound traffic.

AllowVNetOutBound 65000 Outbound VirtualNetwork VirtualNetwork Any Allow Permits egress to any destination within the VNet.

AllowInternetOutBound 65001 Outbound VirtualNetwork Internet Any Allow Permits outbound egress directly to the public internet.

DenyAllOutBound 65500 Outbound Any Any Any Deny Default drop for all unmatched outbound traffic.

Critical Security Warning: The default rule AllowInternetOutBound allows any virtual machine to initiate outbound connections to internet destinations. In high-security environments, override this by creating an outbound custom rule (e.g., Priority 4000 ) that denies outbound access to Internet or forces egress through Azure Firewall.

Application Security Groups (ASGs) for Micro-segmentation

Managing NSG rules using explicit static IP addresses becomes unmanageable as infrastructure scales. Application Security Groups (ASGs) enable logical grouping of virtual machine NICs based on application workload identity (e.g., ASG-Web , ASG-App , ASG-Database ).

Key Benefits of ASGs

Zero-Trust Micro-segmentation: Define security policies based on application role rather than IP ranges.

Dynamic Policy Application: When a new VM is provisioned and assigned to ASG-App , it automatically inherits all NSG rules specifying ASG-App as source or destination.

Single NSG Management: A single NSG attached to a shared subnet can enforce strict isolation between Web, App, and DB tiers without maintaining complex IP lists.

NSG Rule Evaluation Matrix with ASGs

  • Priority Direction Source Destination Dest Port Protocol Access Security Purpose
  • 100 Inbound Internet ASG-Web 443 TCP Allow Allow public HTTPS to Web VMs
  • 200 Inbound ASG-Web ASG-App 8080 TCP Allow Web tier communicates with App tier
  • 300 Inbound ASG-App ASG-DB 1433 TCP Allow App tier accesses SQL Database VMs
  • 400 Inbound Any ASG-DB Any Any Deny Block non-App traffic to Database VMs
  • 4000 Outbound VirtualNetwork Internet Any Any Deny Block direct Internet outbound egress
  • Azure Service Endpoints & Service Endpoint Policies

By default, Azure PaaS services (e.g., Azure Storage, Azure SQL Database) are exposed via public IP endpoints. Service Endpoints optimize PaaS connectivity by routing traffic directly over the Microsoft global backbone network.

Service Endpoint Mechanics

When enabled on a subnet (e.g., Microsoft.Storage ), the route for that service changes from public internet routing to direct private VNet backbone routing.

PaaS firewalls can then be configured to accept traffic only from authorized VNet subnets , blocking all general public internet traffic.

Traffic retains source private IP identity when accessing the PaaS resource.

Service Endpoint Policies (Exfiltration Prevention)

A critical security limitation of standard Service Endpoints is that VMs in the subnet can access any Azure Storage account in any subscription across Azure. This creates a data exfiltration vector where an attacker could copy sensitive internal data to an unauthorized external storage account.

Service Endpoint Policies restrict outbound Service Endpoint access to specific, approved Azure Storage accounts or specific Resource Groups/Subscriptions, effectively blocking unauthorized data transfer.

Forced Tunneling & User Defined Routes (UDRs)

Forced Tunneling ensures all internet-bound traffic originating from Azure subnets is redirected (tunneled) back to an inspection device—either an on-premises firewall via ExpressRoute/S2S VPN or an in-VNet Azure Firewall appliance—rather than exiting directly to the internet.

Implementation via Custom Route Tables (UDRs)

To enforce forced tunneling:

Create a custom Route Table and associate it with target workload subnets.

Define a route for prefix 0.0.0.0/0 with Next Hop Type set to:

VirtualAppliance (IP address of Azure Firewall or third-party NVA).

VirtualNetworkGateway (for routing via BGP to on-premises security stacks).

VNet Peering Security Configuration

Virtual Network Peering connects two Azure VNets with ultra-low latency over the Microsoft backbone. Peering is non-transitive by default (if VNet A is peered to VNet B, and VNet B is peered to VNet C, VNet A cannot communicate with VNet C without explicit peering or central routing).

Key Peering Security Flags

Allow Virtual Network Access ( AllowVNetAccess ): Enables resources in peered VNets to communicate using the default AllowVNetInBound NSG rule. If disabled, traffic between peered VNets is blocked unless explicitly permitted.

Allow Forwarded Traffic ( AllowForwardedTraffic ): Permits traffic not originating from within the peered VNet (e.g., traffic routed through a Network Virtual Appliance or gateway) to enter the VNet. Must be enabled on hub/spoke firewalls.

Allow Gateway Transit & Use Remote Gateways: Allows spoke VNets to utilize a shared Virtual Network Gateway or Azure Bastion host located in a central Hub VNet, consolidating perimeter ingress/egress.

Loading diagram... Virtual Network Peering and Micro-segmentation Architecture