Soru

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

You have an Azure subscription that contains a virtual network named `VNet1`. `VNet1` contains two subnets:
- `Subnet-Web` (10.0.1.0/2410.0.1.0/24)
- `Subnet-DB` (10.0.2.0/2410.0.2.0/24)

The following virtual machines are deployed in `VNet1`:
- `VM-Web1` is in `Subnet-Web` and its network interface is associated with an Application Security Group named `ASG-Web`.
- `VM-DB1` is in `Subnet-DB` and its network interface is associated with an Application Security Group named `ASG-DB`.

The following Network Security Groups (NSGs) are configured and associated:
- `NSG-Subnet` is associated with `Subnet-Web` and contains the following outbound security rule:
- Priority: 150150
- Source: `*`
- Destination: 10.0.2.0/2410.0.2.0/24
- Port: `*`
- Protocol: `Any`
- Action: `Deny`
- `NSG-NIC-DB` is associated with the network interface of `VM-DB1` and contains the following inbound security rule:
- Priority: 200200
- Source: 10.0.1.0/2410.0.1.0/24
- Destination: `*`
- Port: `*`
- Protocol: `Any`
- Action: `Deny`

All other NSG settings and rules are at their default values.

You need to allow SSH (TCP port 2222) and HTTPS (TCP port 443443) connections from `VM-Web1` to `VM-DB1`. The solution must follow the principle of least privilege.

Which two actions should you perform? (Select two.)

  1. In `NSG-Subnet`, add an outbound security rule with a priority of 120120 that allows TCP ports 2222 and 443443 from `ASG-Web` to `ASG-DB`.Cevap
  2. In `NSG-NIC-DB`, add an inbound security rule with a priority of 180180 that allows TCP ports 2222 and 443443 from `ASG-Web` to `ASG-DB`.Cevap
  3. C
    In `NSG-Subnet`, add an outbound security rule with a priority of 180180 that allows TCP ports 2222 and 443443 from `ASG-Web` to `ASG-DB`.
  4. D
    In `NSG-NIC-DB`, add an inbound security rule with a priority of 220220 that allows TCP ports 2222 and 443443 from `ASG-Web` to `ASG-DB`.
  5. E
    In `NSG-Subnet`, add an inbound security rule with a priority of 120120 that allows TCP ports 2222 and 443443 from `ASG-Web` to `ASG-DB`.

Cevap

To allow SSH and HTTPS connections from VM-Web1 to VM-DB1 while maintaining the principle of least privilege, you must add an outbound security rule in NSG-Subnet with a priority of 120 that allows TCP ports 22 and 443 from ASG-Web to ASG-DB, and add an inbound security rule in NSG-NIC-DB with a priority of 180 that allows TCP ports 22 and 443 from ASG-Web to ASG-DB.
For the traffic to succeed, it must pass both the outbound evaluation at the source subnet level and the inbound evaluation at the destination NIC level. In `NSG-Subnet`, adding an outbound Allow rule with a priority of 120120 successfully overrides the Deny rule at priority 150150. In `NSG-NIC-DB`, adding an inbound Allow rule with a priority of 180180 successfully overrides the Deny rule at priority 200200. Both rules target `ASG-Web` as the source and `ASG-DB` as the destination for ports 2222 and 443443, which maintains the principle of least privilege.

Adım Adım Çözüm

1
Analyze the outbound path from `VM-Web1`.
Outbound traffic from `VM-Web1` is processed by the subnet NSG `NSG-Subnet`.
Before leaving the subnet, traffic is evaluated against outbound rules. The existing rule has a priority of 150150 and blocks all outbound traffic to `Subnet-DB` (10.0.2.0/2410.0.2.0/24).
2
Resolve the outbound block in `NSG-Subnet`.
An outbound rule with a priority lower than 150150 (such as 120120) must be added.
Azure processes rules in order of priority (lower numbers first). To allow SSH (2222) and HTTPS (443443) traffic from `ASG-Web` to `ASG-DB` before the Deny rule is processed, the new rule must have a priority number less than 150150.
3
Analyze the inbound path to `VM-DB1`.
Inbound traffic is evaluated by the network interface NSG `NSG-NIC-DB`.
Since `Subnet-DB` has no subnet-level NSG, the traffic is evaluated directly at the NIC-level NSG. The existing rule has a priority of 200200 and blocks all inbound traffic from `Subnet-Web` (10.0.1.0/2410.0.1.0/24).
4
Resolve the inbound block in `NSG-NIC-DB`.
An inbound rule with a priority lower than 200200 (such as 180180) must be added.
To allow the traffic to pass the NIC-level NSG, an inbound Allow rule for TCP ports 2222 and 443443 targeting `ASG-Web` to `ASG-DB` must be processed before the Deny rule at priority 200200.

Anahtar Kavram

Azure NSGs evaluate rules sequentially using priority numbers where lower numbers have higher precedence. When traffic flows across subnets, outbound rules on the source subnet/NIC are evaluated first, followed by inbound rules on the destination subnet/NIC.
Bu soruyu puanla