Skill 4.2.2

Evaluate effective security rules in NSGs

Key Concepts

For inbound traffic, Azure evaluates the NSG on the subnet first and then the NSG on the network interface; for outbound traffic, the NIC NSG first and then the subnet NSG. Traffic is allowed only if both NSGs allow it, and a missing NSG at one level does not filter. A common exam scenario is a subnet NSG that allows HTTP while the NIC NSG has only default rules, so inbound HTTP from the internet is denied by the NIC's DenyAllInBound rule.

The Effective security rules view on a NIC (or Network Watcher's effective security rules) lists the combined rules from both NSGs and expands service tags and ASGs into prefixes. IP flow verify tests a specific five-tuple and names the rule that allows or denies it, and NSG diagnostics shows how each NSG in the path treats the traffic. Within an NSG, rules are evaluated by priority regardless of whether they allow or deny.