Soru

Zorluk: OrtaConfigure Network Security Groups (NSGs) and Application Security Groups (ASGs)

An administrator is configuring network security for an Azure virtual network named `VNet1`. `VNet1` contains a subnet named `Subnet1`.

The subnet contains two virtual machines: `VM-Web` and `VM-DB`.
- `VM-Web` is associated with an Application Security Group (ASG) named `ASG-Web`.
- `VM-DB` is associated with an ASG named `ASG-DB`.

A Network Security Group (NSG) named `NSG-Subnet` is associated with `Subnet1`.
An NSG named `NSG-NIC-DB` is associated with the network interface of `VM-DB`.

The inbound rules for `NSG-Subnet` are configured as shown in the following table:

PrioritySourcePortDestinationPortProtocolAction
100100InternetAny`ASG-Web`443443TCPAllow
200200AnyAnyAnyAnyAnyDeny

The inbound rules for `NSG-NIC-DB` are configured as shown in the following table:

PrioritySourcePortDestinationPortProtocolAction
150150AnyAny`ASG-DB`14331433TCPDeny
250250`ASG-Web`Any`ASG-DB`14331433TCPAllow

Currently, SQL database traffic from `VM-Web` to `VM-DB` is blocked.

Which two configuration changes should you perform to allow SQL traffic from `VM-Web` to `VM-DB`? (Select two.)

  1. In `NSG-Subnet`, add an inbound rule with priority 150150 that allows TCP port 14331433 from source `ASG-Web` to destination `ASG-DB`.Cevap
  2. In `NSG-NIC-DB`, change the priority of the rule that allows TCP port 14331433 to 120120.Cevap
  3. C
    In `NSG-NIC-DB`, change the priority of the rule that allows TCP port 14331433 to 300300.
  4. D
    In `NSG-Subnet`, change the priority of the rule with priority 200200 to 5050.

Cevap

To allow SQL traffic, you must add an inbound rule in `NSG-Subnet` with priority 150150 that allows TCP port 14331433 from source `ASG-Web` to destination `ASG-DB`, and in `NSG-NIC-DB`, change the priority of the rule that allows TCP port 14331433 to 120120.
To allow SQL traffic from the web server to the database server, two configuration adjustments are required because inbound traffic is evaluated by both the subnet-level Network Security Group (NSG) and the network interface-level (NIC) NSG. At the subnet level, the custom Deny rule at priority 200200 blocks all traffic. To bypass this, an Allow rule for port 14331433 with a higher priority (such as 150150) must be added. At the NIC level, the Allow rule for port 14331433 has a priority of 250250, which has lower precedence than the Deny rule at priority 150150. Changing the Allow rule's priority to a lower number (such as 120120) ensures it is evaluated first, allowing the SQL traffic.

Adım Adım Çözüm

1
Analyze the subnet-level NSG (`NSG-Subnet`) inbound traffic evaluation.
The subnet-level NSG has a custom rule at priority 200200 that denies all inbound traffic. Since this has a lower number than the default `AllowVnetInbound` rule (priority 6500065000), the SQL traffic from `VM-Web` to `VM-DB` is blocked at the subnet level.
Azure NSGs evaluate rules in order of priority (lowest number first). A custom deny-all rule with priority 200200 overrides the default VNet-internal allow rules.
2
Determine the required rule addition for `NSG-Subnet`.
Add an inbound rule to `NSG-Subnet` with priority 150150 that allows TCP port 14331433 from `ASG-Web` to `ASG-DB`.
Creating an allow rule with a priority number lower than 200200 ensures that SQL traffic matches this rule and is allowed before reaching the Deny All rule.
3
Analyze the NIC-level NSG (`NSG-NIC-DB`) inbound traffic evaluation.
At the NIC level, the deny rule on port 14331433 (priority 150150) is evaluated before the allow rule (priority 250250). This causes the SQL traffic to be blocked at the network interface.
The rule with priority 150150 takes precedence over the rule with priority 250250 because it has a lower priority number.
4
Determine the required modification for `NSG-NIC-DB`.
Change the priority of the allow rule to a value lower than 150150 (such as 120120).
This reorders the evaluation so the SQL traffic matches the Allow rule first.

Anahtar Kavram

Azure NSG rules are evaluated sequentially by priority number, where lower numbers have higher precedence. Inbound traffic to a VM must be allowed by both the subnet-level NSG and the NIC-level NSG.
Tahmini Süre:1m 30s
Bu soruyu puanla