Home > Glossary > Microsoft Azure Fundamentals > Network Security Group (NSG)

📖 What is Network Security Group (NSG)?

Network Security Group (NSG) is a filter for network traffic that contains a list of security rules that allow or deny inbound and outbound traffic. These rules are applied to network interfaces or subnets to protect Azure resources from unauthorized access.

🥋 Sensei Says:

"Remember that NSG rules are processed by priority; the lower the number, the higher the priority."

📚 Certification: Microsoft Azure Fundamentals (AZ-900)

🔑 What are the Key Concepts of Network Security Group (NSG)?

  • Rule Priority: Rules are processed in order from lowest to highest number; once a match is found, processing stops and that rule is applied.
  • Application Scope: NSGs can be associated with either an individual network interface (NIC) or an entire subnet to provide flexible, layered security boundaries.
  • Traffic Direction: NSGs manage both inbound traffic entering the resource and outbound traffic leaving the resource using two separate sets of security rules.
  • Default Rules: Every NSG includes default rules that allow communication within the virtual network and outbound internet access, which can be overridden by custom rules.
  • Five-Tuple Matching: Rules filter traffic based on five specific criteria: source, source port, destination, destination port, and the protocol used (TCP or UDP).

🎯 How does Network Security Group (NSG) appear on the AZ-900 Exam?

You may be asked to identify the correct tool for blocking specific ports, such as port 80 or 443, to prevent unauthorized web traffic from reaching a virtual machine.

A scenario might describe a need to secure an entire group of virtual machines simultaneously; you should recognize that applying an NSG at the subnet level is the most efficient solution.

Expect questions where you must determine which rule takes precedence when multiple rules overlap, requiring you to identify the rule with the lowest priority number as the winning rule.

❓ Frequently Asked Questions

Can an NSG be applied to both a subnet and a network interface at the same time?

Yes. For inbound traffic, the subnet NSG is processed first, then the NIC NSG. For outbound traffic, the NIC NSG is processed first, followed by the subnet NSG.


What happens if no custom rules match the traffic being sent to a resource?

The traffic is evaluated against the default security rules. If no default rule allows the traffic, it is blocked by the final 'deny all' rule.

Related Terms from Microsoft Azure Fundamentals

📝 Related Study Guides

Study Guide 10 min read

Azure Fundamentals (AZ-900): How to Pass on Your First Try

To pass the Azure AZ-900 exam, focus on the three core domains: Cloud Concepts, Azure Architecture, and Management and Governance. Combine Microsoft Learn's free modules with high-volume practice exams—like the 1,000 questions at Cert Sensei—to master service distinctions and governance tools. Aim for a 700/1000 score across 40-60 questions.

Deep Dive 8 min read

What is an Azure Resource Group? AZ-900 Governance Guide

An Azure Resource Group is a logical container that holds related resources for an Azure solution. It enables efficient lifecycle management, allowing you to deploy, update, and delete a group of resources as a single unit, while providing a centralized point for applying governance, security policies, and Role-Based Access Control (RBAC).

Comparison 7 min read

Azure Data Lake vs Blob Storage: AZ-900 Explained

Azure Blob Storage is object storage for unstructured data using a flat namespace. Azure Data Lake Storage Gen2 builds on Blob storage by adding a hierarchical namespace, making it optimized for big data analytics and high-performance Hadoop workloads. For AZ-900, choose Data Lake when you see "hierarchical" or "analytics."

🧠

Test Your Knowledge

Think you understand Network Security Group (NSG)? Put it to the test with our practice exam.

Try 10 Free Questions

⭐ 1,000 expert-curated questions available with Premium

Upgrade Premium