You have an Azure virtual machine that hosts a web application. You need to allow inbound HTTP (80) and HTTPS (443) traffic from the internet to this VM only. You also need to allow outbound traffic to the internet from the VM. You want to use a managed Azure service with minimal configuration. What should you use?
Trap 1: Azure Application Gateway
Azure Application Gateway is a layer-7 load balancer and Web Application Firewall designed to route inbound HTTP/HTTPS traffic to backend pools based on URL paths, host headers, or other L7 attributes. For a single VM needing basic per-VM connectivity rules, it introduces significant operational overhead—you must configure listeners, routing rules, and health probes—and it does not manage outbound internet access from the VM. Therefore, while it could technically proxy incoming web traffic, it is not the minimal, direct security control required here.
Trap 2: Azure Firewall
Azure Firewall is not the appropriate choice here because it is designed for centralised network security across multiple workloads or virtual networks, not for securing a single VM directly with minimal configuration. Implementing it for a lone VM would introduce unnecessary routing complexity and cost. However, it is tempting as a managed firewall service, and would be the correct option for enterprise-grade scenarios requiring advanced, centralised traffic filtering, threat intelligence, and policy enforcement for an entire network.
Trap 3: Azure Bastion
Azure Bastion is a fully managed platform-as-a-service offering that provides secure, browser-based RDP and SSH connectivity to virtual machines over the Azure portal. It does not filter general application traffic such as HTTP/HTTPS, nor does it govern outbound internet access from the workload—it only mediates interactive administrative sessions. Deploying Bastion for this requirement would be both functionally irrelevant and an unnecessary cost, as it is not a network security control for application data plane traffic.
- A
Azure Application Gateway
Why wrong: Azure Application Gateway is a layer-7 load balancer and Web Application Firewall designed to route inbound HTTP/HTTPS traffic to backend pools based on URL paths, host headers, or other L7 attributes. For a single VM needing basic per-VM connectivity rules, it introduces significant operational overhead—you must configure listeners, routing rules, and health probes—and it does not manage outbound internet access from the VM. Therefore, while it could technically proxy incoming web traffic, it is not the minimal, direct security control required here.
- B
Azure Firewall
Why wrong: Azure Firewall is not the appropriate choice here because it is designed for centralised network security across multiple workloads or virtual networks, not for securing a single VM directly with minimal configuration. Implementing it for a lone VM would introduce unnecessary routing complexity and cost. However, it is tempting as a managed firewall service, and would be the correct option for enterprise-grade scenarios requiring advanced, centralised traffic filtering, threat intelligence, and policy enforcement for an entire network.
- C
Network Security Group (NSG)
A Network Security Group (NSG) is the correct, lightweight choice because it acts as a stateful, distributed packet filter that you can attach directly to the VM's NIC or its subnet. You can define allow/deny rules for inbound HTTP/HTTPS (e.g., ports 80/443) while relying on the default outbound internet access that NSGs permit unless you explicitly block it. It is free, requires no additional infrastructure, and its simplicity aligns perfectly with the requirement to secure a single VM hosting a web application.
- D
Azure Bastion
Why wrong: Azure Bastion is a fully managed platform-as-a-service offering that provides secure, browser-based RDP and SSH connectivity to virtual machines over the Azure portal. It does not filter general application traffic such as HTTP/HTTPS, nor does it govern outbound internet access from the workload—it only mediates interactive administrative sessions. Deploying Bastion for this requirement would be both functionally irrelevant and an unnecessary cost, as it is not a network security control for application data plane traffic.