AZ-900 Practice Question 94: NSG Inbound Filtering
Microsoft Azure Fundamentals (AZ-900) · Test 10 · question 4 of 10
A subnet contains three virtual machines that host an internal API. The team must ensure that only inbound traffic on TCP port 443 from one partner's IP address range can reach those VMs, and that every other inbound request is dropped. Which resource should be attached to the subnet or the VMs' network interfaces to enforce this?
Show answer and explanation
Answer:
A network security group (NSG) contains security rules that allow or deny inbound or outbound traffic, evaluated by source, destination, port, and protocol, and it attaches to a subnet or a network interface, precisely the two attachment points the stem allows. Adding a rule that allows the partner's IP range on TCP 443 covers the requirement, and NSGs already include a default lowest-priority rule that denies all other inbound traffic, so nothing else needs to be added to satisfy "every other inbound request is dropped."
Option B, a load balancer, distributes incoming traffic across multiple instances using health probes; it has no concept of allowing or denying traffic by source IP or port, so it cannot enforce this restriction. Option C, virtual network peering, connects two Azure virtual networks to each other over the Microsoft backbone; it is not scoped to arbitrary external IP ranges and does nothing to filter traffic once connected. Option D, a private endpoint, maps a private IP to an instance of a PaaS resource such as a storage account; it is not something you attach to virtual machines, and it does not filter traffic by port or source address.
Reference: Azure network security groups overview