You have an Azure Network Security Group (NSG) with two inbound rules:
- Rule 100: Allow TCP port 80 from any source
- Rule 200: Deny all inbound traffic
What will happen to an inbound TCP request on port 80?
Remember that NSG rules are processed in order of priority, from lowest number to highest.
NSG rules are evaluated by priority number, lowest first. Rule 100 allows TCP port 80, so the request is allowed before the deny all rule 200 is checked.
You configure an NSG with the following outbound rules:
- Rule 100: Deny outbound traffic to internet IP ranges
- Rule 200: Allow outbound traffic to all destinations
What will be the effect on outbound internet access?
Consider how NSG rules are processed by priority and the effect of deny rules.
NSG outbound rules are processed by priority. Rule 100 denies outbound traffic to internet IPs first, so the traffic is blocked before rule 200 allows all traffic.
An NSG has these inbound rules:
- Rule 100: Allow TCP port 22 from IP range 10.0.0.0/24
- Rule 150: Deny TCP port 22 from IP range 10.0.0.0/16
What is the effective behavior for a connection attempt on TCP port 22 from IP 10.0.1.5?
Check which rule has higher priority and if the IP matches the CIDR ranges.
Rule 150 has priority 150 and denies TCP port 22 from 10.0.0.0/16, which includes 10.0.1.5. Rule 100 allows only 10.0.0.0/24, which does not include 10.0.1.5. So the deny rule applies first.
You have a three-tier application with web, app, and database subnets. You want to allow inbound HTTP traffic only to the web subnet, allow app subnet to communicate with database subnet on port 1433, and block all other traffic.
Which NSG rule set correctly implements this?
Think about which subnet needs access to which ports and from where.
The web subnet allows inbound HTTP from internet. The app subnet needs to communicate with database subnet on port 1433, so database NSG allows inbound TCP 1433 from app subnet. Deny all other traffic ensures no unwanted access.
You manage an NSG with many rules. You notice latency in rule processing and want to optimize.
Which practice will best improve NSG performance and maintain security?
Think about how rule evaluation order and rule count affect performance.
Consolidating rules reduces the total number of rules, and ordering rules by priority with the most frequently matched rules first reduces processing time. This improves performance while maintaining security.