What if one simple set of rules could protect your entire cloud network automatically?
Why NSG rules (inbound, outbound) in Azure? - Purpose & Use Cases
Imagine you have a small office with many doors and windows. You want to decide who can enter or leave through each door every day by writing notes for each visitor and guard. This is like manually controlling network traffic without clear rules.
Manually tracking who can enter or leave through each door is slow and confusing. You might forget to write a note, or give access to the wrong person. This causes delays, mistakes, and security risks.
Network Security Group (NSG) rules let you set clear, simple instructions for inbound and outbound traffic. These rules act like smart guards who automatically check and allow or block traffic based on your settings, making security easy and reliable.
Open all ports and check traffic manuallyCreate NSG rules to allow only needed ports inbound and outboundWith NSG rules, you can safely control who talks to your cloud resources, keeping your network secure and efficient without constant manual checks.
A company uses NSG rules to allow only web traffic (port 80) inbound to their servers and blocks everything else, preventing hackers from accessing sensitive parts of their network.
Manual network control is slow and error-prone.
NSG rules automate and simplify traffic control.
They improve security by clearly defining allowed inbound and outbound traffic.
Practice
Solution
Step 1: Understand NSG function
NSGs are designed to filter network traffic to and from Azure resources.Step 2: Compare options
Only To control inbound and outbound network traffic to resources describes controlling inbound and outbound traffic, which matches NSG's role.Final Answer:
To control inbound and outbound network traffic to resources -> Option CQuick Check:
NSG controls traffic = B [OK]
- Confusing NSG with storage or identity services
- Thinking NSG monitors performance
- Assuming NSG manages user access
Solution
Step 1: Identify direction and protocol
The question asks for inbound TCP traffic on port 80, so Direction must be Inbound and Protocol TCP.Step 2: Check port and action
Port must be 80 and Action Allow to permit traffic.Final Answer:
Priority: 100, Direction: Inbound, Protocol: TCP, Port: 80, Action: Allow -> Option AQuick Check:
Inbound TCP port 80 allow = C [OK]
- Using outbound direction instead of inbound
- Using UDP protocol instead of TCP
- Specifying wrong port number
1) Priority 100: Allow inbound TCP port 22 from 10.0.0.0/242) Priority 200: Deny inbound TCP port 22 from anyWhat will happen if a connection attempt comes from IP 10.0.0.5 on port 22?
Solution
Step 1: Understand rule priority
Lower priority number means higher priority. Priority 100 rule is evaluated before 200.Step 2: Evaluate matching rules
IP 10.0.0.5 matches allow rule at priority 100, so connection is allowed before deny rule is checked.Final Answer:
The connection is allowed because allow rule has higher priority -> Option AQuick Check:
Lower priority allow beats higher priority deny = D [OK]
- Assuming deny always overrides allow
- Ignoring rule priority order
- Thinking private IPs bypass deny rules
Solution
Step 1: Check rule priority and direction
If traffic is blocked despite allow rule, a deny rule with higher priority likely blocks it.Step 2: Evaluate other options
Inbound vs outbound mismatch or protocol mismatch would cause no effect, but the question states rule exists for outbound HTTPS.Final Answer:
There is a higher priority outbound deny rule blocking port 443 -> Option DQuick Check:
Higher priority deny blocks traffic despite allow = A [OK]
- Ignoring rule priority order
- Confusing inbound and outbound directions
- Assuming source IP 0.0.0.0/0 blocks traffic
Solution
Step 1: Allow specific IP range first
Allow rule with higher priority (lower number) must permit traffic from 192.168.1.0/24.Step 2: Deny all other IPs
Deny rule with lower priority blocks all other inbound HTTP traffic.Final Answer:
Priority 100: Allow inbound TCP port 80 from 192.168.1.0/24; Priority 200: Deny inbound TCP port 80 from any -> Option BQuick Check:
Allow specific IP first, then deny others = A [OK]
- Placing deny rule before allow rule
- Allowing all IPs instead of specific range
- Using wrong priority numbers
Ready to prove it?
Pass the test and this pattern moves unknown
