AZ-305 ยท Hybrid networking and network security
Network segmentation with NSGs and ASGs
Network security groups and rules, application security groups, subnet vs NIC association, service tags, NSG flow logs and VNet flow logs.
Key points
- NSG: stateful allow/deny 5-tuple rules on a subnet or NIC.
- Priorities 100-4096; lowest first; stops at first match.
- Default rules (65000-65500): VNet, load balancer and outbound internet allowed, rest denied; cannot be deleted.
- Service tags (Storage, Internet, VirtualNetwork); ASGs group VMs by role (web-to-db).
- Virtual Network Manager security admin rules run before NSGs; use VNet flow logs (NSG flow logs retire September 30, 2027).
Source: https://learn.microsoft.com/en-us/azure/virtual-network/network-security-groups-overview
Practice questions
Which priority values can you assign to a custom NSG security rule?
- 100 to 4096
- 1 to 65535
- 1000 to 65000
- 100 to 65500
Show answer
Answer: A. 100 to 4096
Custom rules use priorities 100 to 4096, with lower numbers processed first. The 65000-65500 range belongs to the default rules, which are kept at the lowest priority so your rules always win.
Which statements about NSG default security rules are correct?
- AllowVNetInBound allows traffic within the VirtualNetwork tag
- You can delete default rules you do not need
- Outbound internet traffic is allowed by default
- A default rule allows RDP from the internet
- DenyAllInbound can be overridden by a custom rule
Show answer
Answer: A. AllowVNetInBound allows traffic within the VirtualNetwork tag, C. Outbound internet traffic is allowed by default, E. DenyAllInbound can be overridden by a custom rule
AllowVNetInBound (65000) allows traffic between VirtualNetwork addresses, AllowInternetOutBound (65001) allows outbound internet by default, and DenyAllInbound (65500) cannot be deleted but is overridden by any higher-priority custom rule. Default rules cannot be removed, and no default rule allows RDP from the internet.
Because NSGs are stateless, every inbound allow rule needs a matching outbound rule so that the replies can leave.
Show answer
Answer: False
False. NSGs are stateful: a flow record lets return traffic for an allowed connection through automatically. You only add a rule in the direction where the connection is initiated.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
