Azure Network Security Groups & Application Security Groups
Introduction
This lab demonstrates how to secure Azure virtual machines using Network Security Groups (NSGs) and Application Security Groups (ASGs). By logically grouping VMs and applying targeted inbound rules, I isolated traffic for Web Servers and Management Servers, enhancing role-based access control and overall cloud security posture.
Objectives
- Create resource group and virtual network
- Define Application Security Groups (ASGs)
- Deploy virtual machines for web and management roles
- Associate NICs with ASGs
- Configure NSGs with role-based inbound rules
- Validate traffic filtering and rule enforcement
Prerequisites
- Azure subscription with contributor or admin access
- Skillable lab environment or Azure sandbox
- Familiarity with Azure Portal and VM deployment
Walkthrough
Task 1: Create Resource Group & Virtual Network
- Created resource group
RG-SecurityLabin East Africa - Deployed virtual network
VNet-SecurityLabwith subnets for Web and Management servers
πΈ Screenshot:step01-resource-group.pngβ Resource group creation

πΈ Screenshot: step01-virtual-network.png β Virtual network setup

Task 2: Create Application Security Groups
- Created ASG
ASG-Webfor web servers - Created ASG
ASG-Managementfor management servers
πΈ Screenshot:step02-asg-web.pngβ ASG for web servers

πΈ Screenshot: step02-asg-management.png β ASG for management servers

Task 3: Deploy Virtual Machines
- Deployed Web Server VM with IIS installed
- Deployed Management Server VM configured for RDP access
πΈ Screenshot:step03-web-vm.pngβ Web VM deployment

πΈ Screenshot: step03-management-vm.png β Management VM deployment

Task 4: Associate NICs with ASGs
- Associated Web VM NIC with
ASG-Web - Associated Management VM NIC with
ASG-Management
πΈ Screenshot:step04-nic-asg.pngβ NIC association with ASGs

Task 5: Configure Network Security Groups
- Created NSG for Web servers: allowed HTTP (port 80), blocked RDP
- Created NSG for Management servers: allowed RDP (port 3389) from trusted IPs, blocked HTTP
πΈ Screenshot:step05-nsg-web.pngβ NSG for web access

πΈ Screenshot: step05-nsg-management.png β NSG for management access

Task 6: Validate Traffic Filtering
- Verified Web Server accessible via browser on port 80
- Verified Management Server accessible via RDP from admin workstation
πΈ Screenshot:step06-iis-access.pngβ IIS access test

πΈ Screenshot: step06-rdp-access.png β RDP access test

Task 7: Final Validation
- Used Azure Network Watcher to confirm traffic flow matches NSG rules
πΈ Screenshot:step07-network-watcher.pngβ Network Watcher validation

Key Learnings
- ASGs simplify rule management by grouping VMs logically
- NSGs enforce traffic filtering based on ASG membership
- Role-based access improves security posture in cloud environments