Description:
HTTP and HTTPS traffic coming from the Internet should be reviewed and restricted so that only required access is allowed. Only the ports and sources needed for the application should be open, and all unnecessary Internet exposure should be blocked.
Rationale:
Allowing HTTP or HTTPS from the Internet without reviewing the need may expose the application to attacks such as scanning, brute-force attempts, or malicious access. Restricting traffic reduces the attack surface and improves the overall security posture.
Impact:
If HTTP or HTTPS access is left open to the Internet, unauthorized users may reach the application or VM. This can lead to data exposure, security breaches, performance issues, or application misuse.
Default Value:
By default, Azure Network Security Groups block inbound traffic unless explicit allow rules are created. When someone manually creates an allow rule for HTTP or HTTPS, it becomes accessible from the Internet.
Pre-requisites:
You must have permission to view or edit Network Security Groups.
You must know whether the application requires HTTP or HTTPS access.
Test Plan:
Sign in to the Azure Portal https://portal.azure.com
Search for Network Security Groups.
Open the NSG associated with the VM or application.
Under Settings, select Inbound security rules.
Review inbound rules for:
Port 80 (HTTP)
Port 443 (HTTPS)
Check the Source field for these rules.
If any HTTP or HTTPS rule allows traffic from Any / 0.0.0.0/0, follow the implementation steps.
Implementation Steps:
Sign in to the Azure Portal https://portal.azure.com
Search for Network Security Groups.
Select the Network Security Group associated with the virtual machine or application.
Under Settings, click Inbound security rules.
Review existing inbound rules that allow:
TCP port 80 (HTTP)
TCP port 443 (HTTPS)
Identify any rule where the Source is set to Any or 0.0.0.0/0.
Delete the rule or edit it to restrict access:
Change Source to specific trusted IP addresses or networks
Keep Protocol as TCP
Keep the Destination port as 80 or 443 only if required
Save the changes.
Backout Plan:
Sign in to the Azure Portal https://portal.azure.com
Search for Network Security Groups.
Open the Network Security Group where HTTP or HTTPS rules were modified.
Under Settings, select Inbound security rules.
Restore the previous HTTP or HTTPS rule if public access is required:
Set Source to Any or 0.0.0.0/0
Set Protocol to TCP
Set Destination port to 80 or 443
Set Action to Allow
Use the original priority and rule name if known
Save the rule.
References:
https://learn.microsoft.com/azure/virtual-network/network-security-groups-overview
https://learn.microsoft.com/azure/virtual-network/manage-network-security-group
https://learn.microsoft.com/azure/security/fundamentals/network-best-practices
https://learn.microsoft.com/azure/virtual-network/network-interface-effective-security-rules
https://learn.microsoft.com/azure/virtual-network/virtual-network-service-tags-overview

