An NSG (Network Security Group) is like a security guard for your cloud network. It controls which traffic can come in (inbound) and go out (outbound) of your virtual machines or subnets.
Click to reveal answer
beginner
What does an inbound NSG rule do?
An inbound NSG rule controls the traffic coming into your resource. It decides if incoming data is allowed or blocked based on rules like IP address, port, and protocol.
Click to reveal answer
beginner
What does an outbound NSG rule do?
An outbound NSG rule controls the traffic leaving your resource. It decides if outgoing data is allowed or blocked based on rules like destination IP, port, and protocol.
Click to reveal answer
intermediate
What are the key parts of an NSG rule?
Each NSG rule has: a priority number (which rule runs first), direction (inbound or outbound), source and destination (IP or subnet), protocol (TCP, UDP, or Any), port range, and action (allow or deny).
Click to reveal answer
intermediate
Why is rule priority important in NSG?
Rule priority decides which rule applies first. Lower numbers have higher priority. If a higher priority rule allows or denies traffic, later rules are ignored for that traffic.
Click to reveal answer
What does an inbound NSG rule control?
ATraffic inside a virtual machine
BTraffic leaving a resource
CTraffic between two Azure regions
DTraffic coming into a resource
✗ Incorrect
Inbound NSG rules control incoming traffic to your resource.
Which part of an NSG rule decides the order of evaluation?
ASource IP
BPriority number
CProtocol type
DPort range
✗ Incorrect
Priority number determines which rule is checked first.
What action can an NSG rule take on traffic?
AAllow or Deny
BEncrypt or Decrypt
CRoute or Block
DLog or Ignore
✗ Incorrect
NSG rules either allow or deny traffic based on conditions.
Which protocol can you specify in an NSG rule?
AHTTP only
BFTP only
CTCP, UDP, or Any
DSMTP only
✗ Incorrect
NSG rules support TCP, UDP, or Any protocol.
If two NSG rules conflict, which one applies?
AThe one with lower priority number
BThe one created last
CThe one with higher priority number
DBoth apply equally
✗ Incorrect
The rule with the lower priority number (higher priority) applies first.
Explain how inbound and outbound NSG rules work together to protect an Azure resource.
Think of inbound as the front door and outbound as the back door security.
You got /4 concepts.
Describe the key components you need to set when creating an NSG rule.
Imagine setting rules for who can enter or leave your house and how.
You got /6 concepts.
Practice
(1/5)
1. What is the primary purpose of an Azure Network Security Group (NSG)?
easy
A. To store data securely in the cloud
B. To manage user identities and access
C. To control inbound and outbound network traffic to resources
D. To monitor application performance
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 C
Quick Check:
NSG controls traffic = B [OK]
Hint: NSG controls traffic flow, not data or users [OK]
Common Mistakes:
Confusing NSG with storage or identity services
Thinking NSG monitors performance
Assuming NSG manages user access
2. Which of the following is the correct way to specify an inbound NSG rule to allow TCP traffic on port 80?
3. Given these NSG rules applied in order of priority: 1) Priority 100: Allow inbound TCP port 22 from 10.0.0.0/24 2) Priority 200: Deny inbound TCP port 22 from any What will happen if a connection attempt comes from IP 10.0.0.5 on port 22?
medium
A. The connection is allowed because allow rule has higher priority
B. The connection is allowed because deny rules do not apply to private IPs
C. The connection is denied because default deny applies
D. The connection is denied because deny rule has higher priority
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 A
Quick Check:
Lower priority allow beats higher priority deny = D [OK]
Hint: Lower priority number rules apply first [OK]
Common Mistakes:
Assuming deny always overrides allow
Ignoring rule priority order
Thinking private IPs bypass deny rules
4. You created an NSG rule to allow outbound HTTPS traffic on port 443, but traffic is still blocked. Which of the following is the most likely cause?
medium
A. The source IP address range is set to 0.0.0.0/0
B. The NSG rule is set to inbound instead of outbound
C. The protocol is set to UDP instead of TCP
D. There is a higher priority outbound deny rule blocking port 443
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 D
Quick Check:
Higher priority deny blocks traffic despite allow = A [OK]
Hint: Check for higher priority deny rules first [OK]
Common Mistakes:
Ignoring rule priority order
Confusing inbound and outbound directions
Assuming source IP 0.0.0.0/0 blocks traffic
5. You want to allow inbound HTTP traffic only from a specific IP range 192.168.1.0/24 and deny all other inbound HTTP traffic. Which NSG rule configuration achieves this?
hard
A. Priority 100: Deny inbound TCP port 80 from any; Priority 200: Allow inbound TCP port 80 from 192.168.1.0/24
B. Priority 100: Allow inbound TCP port 80 from 192.168.1.0/24; Priority 200: Deny inbound TCP port 80 from any
C. Priority 100: Allow inbound TCP port 80 from any; Priority 200: Deny inbound TCP port 80 from 192.168.1.0/24
D. Priority 100: Deny inbound TCP port 80 from 192.168.1.0/24; Priority 200: Allow inbound TCP port 80 from any
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 B
Quick Check:
Allow specific IP first, then deny others = A [OK]
Hint: Allow specific IP with lower priority number, deny others after [OK]
Common Mistakes:
Placing deny rule before allow rule
Allowing all IPs instead of specific range
Using wrong priority numbers
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.