Bitzu

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

Single choice

Which priority values can you assign to a custom NSG security rule?

  1. 100 to 4096
  2. 1 to 65535
  3. 1000 to 65000
  4. 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.

Select all that apply

Which statements about NSG default security rules are correct?

  1. AllowVNetInBound allows traffic within the VirtualNetwork tag
  2. You can delete default rules you do not need
  3. Outbound internet traffic is allowed by default
  4. A default rule allows RDP from the internet
  5. 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.

True or false

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.

Download on the App StoreGet it on Google Play

More AZ-305 topics in this module