惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
Y
Y Combinator Blog
M
MIT News - Artificial intelligence
The Cloudflare Blog
WordPress大学
WordPress大学
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 司徒正美
小众软件
小众软件
Blog — PlanetScale
Blog — PlanetScale
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
J
Java Code Geeks
云风的 BLOG
云风的 BLOG
C
Check Point Blog
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
V
V2EX
F
Fortinet All Blogs
B
Blog
大猫的无限游戏
大猫的无限游戏
N
Netflix TechBlog - Medium
B
Blog RSS Feed
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Create and configure network security groups
Rahimah Sulayman · 2026-05-25 · via DEV Community

Introduction

Want to ensure your web infrastructure is tightly controlled and protected against unauthorized traffic? In this hands-on lab breakdown, I dive into securing a multi-tier architecture in Microsoft Azure. From configuring Network Security Groups (NSGs) for backend subnets to leveraging Application Security Groups (ASGs) to abstract network configurations for Ubuntu web servers, this walkthrough covers the exact skilling tasks required to manage enterprise-grade network filtering policies cleanly.

Scenario

Your organization requires the network traffic in the app-vnet to be tightly controlled. You identify these requirements.

  • The frontend subnet has web servers that can be accessed from the internet. An application security group (ASG) is required for those servers. The ASG should be associated with any virtual machine interface that is part of the group. This will allow the web servers to be easily managed.
  • The backend subnet has database servers used by the frontend web servers. A network security group (NSG) is required to control this traffic. The NSG should be associated with any virtual machine interface that will be accessed by the web servers.
  • For testing, a virtual machine should be installed in the frontend subnet (VM1) and the backend subnet (VM2). The IT group has provided an Azure resource manager template to deploy these Ubuntu servers.

Skilling tasks

  • Create a network security group.
  • Create network security group rules.
  • Associate a network security group to a subnet.
  • Create and use application security groups in network security group rules.

Create the network infrastructure for the exercise

Note: This exercise requires the Create and Configure Virtual Networks Exercise's virtual networks and subnets to be installed.
A template is provided if you need to deploy those resources.

1.Use the icon (top right) to launch a Cloud Shell session. Alternately, navigate directly to https://shell.azure.com.

2.If prompted to select either Bash or PowerShell, select PowerShell.

cloud

3.Storage is not required for this task Select your subscription. Apply your changes.

apply

4.Use these commands to deploy the virtual machines required for this exercise.

Note: If the deployment fails for capacity restriction, edit the template and change the “location” value.

Copy:

$RGName = "RG1"

New-AzResourceGroupDeployment -ResourceGroupName $RGName -TemplateUri https://raw.githubusercontent.com/MicrosoftLearning/Configure-secure-access-to-workloads-with-Azure-virtual-networking-services/main/Instructions/Labs/azuredeploy.json

NOTE: It failed and I had to edit the Template. I also did not use TemplateUri because I now have the file to my local environment.

deployedvms

1.In the portal search for and select virtual machines. Verify both vm1 and vm2 are Running.

running

Create Application Security Group

Application security groups (ASGs) let you group together servers with similar functions. For example, all the web servers hosting your application.

1.In the portal, search for and select Application security groups.

ASG

2.Select + Create and configure the application security group.

createASG

Property Value
Subscription Select your subscription
Resource group RG1
Name app-frontend-asg
Region East US

3.Select Review + create and then select Create.

review

verify

Note: You are creating the application security group in the same region as the existing virtual network.

Associate the application security group to the network interface of the VM

1.In the Azure portal, search for and select VM1.

2.In the Networking blade, select Application security groups and then select Add application security groups.

netwk

3.Select the app-frontend-asg and then select Add.

add

Create and Associate the Network Security Group

Network security groups (NSGs) secure network traffic in a virtual network.

1.In the portal search for and select Network security group.

NSG

2.Select + Create and configure the network security group.

Create

Property Value
Subscription Select your subscription
Resource group RG1
Name app-vnet-nsg
Region East US

3.Select Review + create and then select Create.

review

Associate the NSG with the app-vnet backend subnet.

NSGs can be associated with subnets and/or individual network interfaces attached to Azure virtual machines.

1.Select Go to resource or navigate to the app-vnet-nsg resource.

2.In the Settings blade select Subnets.

3.Select + Associate

4.Select app-vnet (RG1) and then the Backend subnet. Select OK.

appvnet

Create Network Security Group rules

An NSG use security rules to filter inbound and outbound network traffic.

1.In the search box at the top of the portal, enter Network security groups. Select Network security groups in the search results.

2.Select app-vnet-nsg from the list of network security groups.

3.In the Settings blade, select Inbound security rules.

add

4.Select + Add and configure an inbound security rule.

Property Value
Source Any
Source port ranges ***
Destination Application Security group
Destination application security group app-frontend-asg
Service SSH
Action Allow
Priority 100
Name AllowSSH

AllowSSH

Key takeaways
Here are the main takeaways:

  • Application security groups let you organize virtual machines and define network security policies based on your organization’s applications.
  • An Azure network security group is used to filter network traffic between Azure resources in an Azure virtual network.
  • You can associate zero, or one, network security group to each virtual network subnet and network interface in a virtual machine.
  • A network security group contains security rules that allow or deny inbound network traffic to, or outbound network traffic from, Azure resources.
  • You join virtual machines to an application security group. Then you use the application security group as a source or destination in the network security group rules.

Conclusion

This technical project demonstrates how to implement a Zero-Trust network architecture within Microsoft Azure to secure a multi-tier application. By decoupling network security rules from IP addresses and subnets, the design ensures that communication between frontend web servers and backend database workloads is tightly controlled, audited, and scalable.