exam questions

Exam AZ-104 All Questions

View all questions & answers for the AZ-104 exam

Exam AZ-104 topic 5 question 96 discussion

Actual exam question from Microsoft's AZ-104
Question #: 96
Topic #: 5
[All AZ-104 Questions]

HOTSPOT -
You have a virtual network named VNET1 that contains the subnets shown in the following table:

You have Azure virtual machines that have the network configurations shown in the following table:

For NSG1, you create the inbound security rule shown in the following table:

For NSG2, you create the inbound security rule shown in the following table:

For each of the following statements, select Yes if the statement is true. Otherwise, select No.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: Yes -
The inbound security rule for NSG1 allows TCP port 1433 from 10.10.2.0/24 (or Subnet2 where VM2 and VM3 are located) to 10.10.1.0/24 (or Subnet1 where
VM1 is located) while the inbound security rule for NSG2 blocks TCP port 1433 from 10.10.2.5 (or VM2) to 10.10.1.5 (or VM1). However, the NSG1 rule has a higher priority (or lower value) than the NSG2 rule.

Box 2: Yes -
No rule explicitly blocks communication from VM1. The default rules, which allow communication, are thus applied.

Box 3: Yes -
No rule explicitly blocks communication between VM2 and VM3 which are both on Subnet2. The default rules, which allow communication, are thus applied.
Reference:
https://docs.microsoft.com/en-us/azure/virtual-network/security-overview

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
JohnAvlakiotis
Highly Voted 4 years, 3 months ago
I believe it should be No, Yes, Yes. The NSG2 on the NIC of VM1 blocks the request that passes through NSG1 which is attached on the subnet. There is no priority bypass between NSGs. Traffic is filtered independently between NSGs.
upvoted 326 times
rusll
4 years, 2 months ago
I agree, mixing the rules would create a problem : in case we have two rules with the same priority, how would we decide ...
upvoted 5 times
Patesso
1 year, 8 months ago
Pour le trafic entrant les regles NSG attachees au Reseau sont prioritaires
upvoted 2 times
...
...
rcdumps
4 years, 2 months ago
The NSG2 blocks INBOUND requests, not OUTBOUND, hence VM2 can reach VM1.
upvoted 11 times
JamesDC
4 years, 1 month ago
Oh Dear!... do you understand VM2 and VM is on different subnets and both NSGs are applicable on subnet1 resources... so, there's no concept of outbound rule... Agree with Jhon, NSG1 is on subnet and NSG2 is on NIC, even VM2 can enter to the sunbet1 but NSG2 will block while going to VM1.
upvoted 22 times
Batiste2023
1 year, 3 months ago
What you're saying is that for traffic between different subnets within a VNET, inbound rules block outbound connections - is there any source to document this? For now I am not convinced and would go for YYY...
upvoted 1 times
...
...
tita_tovenaar
3 years, 7 months ago
thought so too but it is wrong. Look at the destination addresses. Basically you can imagine that NSG1 covers subnet 1 and NSG2 covers VM1 specifically. Tricky question, but answer is No. VM3 could RDP into VM1, if that makes it more clear.
upvoted 5 times
...
klexams
2 years, 4 months ago
NSG2 is on VM1 so it block inbound to VM1.
upvoted 3 times
...
...
Bhuw
2 years, 7 months ago
Think you're correct https://docs.microsoft.com/en-us/azure/virtual-network/network-security-group-how-it-works#inbound-traffic
upvoted 2 times
...
Indy429
1 year, 2 months ago
This is wrong. "A number between 100 and 4096. Rules are processed in priority order, with lower numbers processed before higher numbers, because lower numbers have higher priority. Once traffic matches a rule, processing stops. As a result, any rules that exist with lower priorities (higher numbers) that have the same attributes as rules with higher priorities aren't processed. Azure default security rules are given the highest number with the lowest priority to ensure that custom rules are always processed first." So it should be Yes - Yes - Yes. Source: https://learn.microsoft.com/en-us/azure/virtual-network/network-security-groups-overview
upvoted 1 times
bhadrisn
1 year, 2 months ago
@Indy, NSG1 is at subnet level and NSG2 is at VM level, so, when the traffic flows, NSG1 subnet is evaluated first and then if passed, NSG2 subnet at VM level is evaluated. Here, the number priority doesnt come into picture. So, correct answer is No, Yes, Yes
upvoted 8 times
bhadrisn
1 year, 2 months ago
typo NSG2 (remove subnet) at VM level
upvoted 1 times
...
Indy429
1 year, 2 months ago
You are right, I misread. Thank you
upvoted 3 times
...
...
...
...
aaa112
Highly Voted 4 years, 2 months ago
1. NO - VM1 has the NSG1 on Subnet1, which allows traffic over port 1433 between Subnet2 and Subnet1. BUT NSG2 also applied on NIC level for VM1 that blocks the traffic on port 1433. Hence No traffic allowed. Answer is NO. 2. YES - For VM2 there are no NSGs applied neither on subnet or NIC level hence all traffic is allowed. 3. YES - For VM3 there are no NSGs applied neither on subnet or NIC level hence all traffic is allowed.
upvoted 192 times
monus
3 years, 5 months ago
yes, NSG at subnet as well as VM has to be open in order to allow traffic
upvoted 2 times
...
subramani2018
2 years, 12 months ago
but by default tcp3389 blocked in nsg for vm3 right..
upvoted 2 times
lebeyic620
11 months ago
from internet, not vnet
upvoted 1 times
...
...
MrJR
3 years, 5 months ago
Your answer is correct. NYY. Just a small correction. For traffic from VM1 two network security groups apply but both have the default rule AllowVnetOutbound so the outbound traffic to VM2 is allowed. For VM2 no network security group applies so the inbound traffic is allowed as well.
upvoted 4 times
...
RogerDingo
4 years, 2 months ago
thanks for confirming.. i came to the same conclusion as you.
upvoted 9 times
...
...
[Removed]
Most Recent 5 months, 1 week ago
WRONG No Yes Yes there is no NSG applied on VM2 & VM3
upvoted 1 times
...
joolitan
5 months, 1 week ago
- VM2 can connect to TCP port 1433 services on VM1 = No (VM1 use NSG2, inbound block regardless of priority) - VM1 can connect to TCP port 1433 services on VM2 = Yes (VM2 no NSG. So, all allowed) - VM2 can connect to TCP port 1433 services on VM3 = Yes (VM3 no NSG. So, all allowed)
upvoted 2 times
...
adilkhan
7 months, 4 weeks ago
N,Y,Y IS CORRECT
upvoted 1 times
...
ashtonez
10 months, 3 weeks ago
Solution is NO NO YES . Explanation: NO vm2 traffic is blocked by the rule priority 125 from NSG2 at subnet1 when it reach subnet1 before reaching vm1 NO vm1 traffic is blocked by the default deny all rule from NSG2 at subnet1 YES no NSG present so traffic is allowed by default The key here, whenever you push traffic , it goes throug all the steps, outgoing vm > nic > subnet , incoming subnet > nic > vm
upvoted 1 times
ashtonez
10 months, 3 weeks ago
Also let me add, that there are no NSG taking precedence over other NSG, you just need to go through all the NSG at every resource (subnet, vm or whatever)
upvoted 1 times
...
...
bobothewiseman
11 months, 2 weeks ago
N Y Y NSG rules applied at the VM level take precedence over rules applied at the subnet level. If there are conflicting rules, the VM-level rule will be applied.
upvoted 1 times
...
tashakori
11 months, 3 weeks ago
No Yes Yes
upvoted 1 times
...
TSKARAN
11 months, 4 weeks ago
Always, we need to take too many assumptions here, the windows built-in firewall, already configured. Windows server is already running the services in the port, TCP/1433
upvoted 1 times
...
belyo
1 year ago
as TCP is bi-directional is am wondering is it NO-NO-YES VM2 would never be able to confirm anything to VM1 on that blocked tcp port...
upvoted 1 times
...
Indy429
1 year, 2 months ago
Shouldn't it be NO YES YES? Like the answer is litterally in the question, first Q1 can't be a YES. It has to be NO.
upvoted 1 times
...
Indy429
1 year, 2 months ago
I see a lot of people saying that Q1 should be No, but look at the Priorities. Priority 101 is higher than Priority 125 and will thereby be override by 101, so following that logic, it should be: Yes Yes Yes
upvoted 1 times
itismadu
5 months, 2 weeks ago
priority does not span across NSGs. Each Network Security Group (NSG) operates independently when evaluating its own set of rules. The priority of the rules is only relevant within the same NSG, not across different NSG
upvoted 2 times
...
bobothewiseman
11 months ago
because we are right and you are wrong. it should be NYY NSG1 and NSG2 are different set of rules. so priority is not a question on this scenario
upvoted 1 times
...
...
josola
1 year, 3 months ago
1. VM2 to VM1. VM1 is in subnet 1 that has NSG1 associated. This NSG allow inbound TCP 1433. Vm1 has NSG2 associated, which denies traffic from VM2 specifically. Priority doesn’t have anything to do with traffic evaluation because they’re different rules. Then answer No. 2. VM1 to VM2. VM2 is in subnet2 that has no subnet NSG associated, and no VM NSG. VM1 and VM2 are in different subnets in the same VNET, or same address space. Then traffic is allowed. Answer Yes. https://learn.microsoft.com/en-us/azure/virtual-network/virtual-networks-udr-overview 3. VM2 to VM3. VM2 and VM3 are in the same subnet AND no defined NSGs that deny traffic. Answer Yes. https://learn.microsoft.com/en-us/azure/virtual-network/network-security-group-how-it-works
upvoted 4 times
...
ziggy1117
1 year, 3 months ago
N - Y - Y Intra-Subnet traffic It's important to note that security rules in an NSG associated to a subnet can affect connectivity between VMs within it. By default, virtual machines in the same subnet can communicate based on a default NSG rule allowing intra-subnet traffic. If you add a rule to NSG1 that denies all inbound and outbound traffic, VM1 and VM2 won't be able to communicate with each other. https://learn.microsoft.com/en-us/azure/virtual-network/network-security-group-how-it-works In our example, its explicit in the NSG NIC rule that VM2 cannot connect to VM1 in the said port
upvoted 1 times
...
Ahkhan
1 year, 3 months ago
No, yes, and yes.
upvoted 1 times
...
DWILK
1 year, 4 months ago
so even though they are applied to different VM's the NSG1 has priority? NO
upvoted 1 times
...
sumaju
1 year, 5 months ago
For Inbound traffic, -> Subnet -> NI, NSG rules are evaluated in this sequence. For Outbound traffic, NI-> Subnet -> Vnet , NSG rules are evaluated in this sequence. If there is any explicit deny ( with high priority within that NSG) at any level, traffic will be blocked. So the answer is NYY.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago