| name | cis-azure-foundations-7.3 |
| description | Ensure UDP access from the Internet is evaluated and restricted |
| category | cis-azure-foundations |
| version | 5.0.0 |
| author | cyberstrike-official |
| tags | ["cis","azure","networking","nsg"] |
| cis_id | 7.3 |
| cis_benchmark | CIS Microsoft Azure Foundations Benchmark v5.0.0 |
| tech_stack | ["azure"] |
| cwe_ids | [] |
| chains_with | ["cis-azure-foundations-7.1","cis-azure-foundations-7.2","cis-azure-foundations-7.4","cis-azure-foundations-7.11"] |
| prerequisites | [] |
| severity_boost | {} |
Ensure UDP access from the Internet is evaluated and restricted
Description
Network security groups should be periodically evaluated for port misconfigurations. Where UDP is not explicitly required and narrowly configured for resources attached to a network security group, Internet-level access to Azure resources should be restricted or eliminated.
Rationale
The potential security problem with broadly exposing UDP services over the Internet is that attackers can use DDoS amplification techniques to reflect spoofed UDP traffic from Azure Virtual Machines. The most common types of these attacks exploit exposed DNS, NTP, SSDP, SNMP, CLDAP, and other UDP-based services as amplification sources to disrupt services on other machines within the Azure Virtual Network, or even attack networked devices outside of Azure.
Impact
None documented. Restricting UDP access from the Internet is a security best practice with no negative functional impact when properly configured.
Audit Procedure
Using Azure Portal
- Go to
Network security groups.
- Click the name of a network security group.
- Under
Settings, click Inbound security rules.
- Ensure that no inbound security rule exists that matches the following:
- Port:
53, 123, 161, 389, or 1900, or range including 53, 123, 161, 389, or 1900, or other vulnerable UDP-based services
- Protocol:
UDP or Any
- Source:
0.0.0.0/0, Internet, or Any
- Action:
Allow
- Repeat steps 1-4 for each network security group.
Using Azure Resource Graph
- Go to
Resource Graph Explorer.
- Click
New query.
- Paste the following into the query window:
resources | where type =~ "microsoft.network/networksecuritygroups" | project id, name, securityRule = properties.securityRules | mv-expand securityRule | extend access = securityRule.properties.access, direction = securityRule.properties.direction, protocol = securityRule.properties.protocol, destinationPort = case(isempty(securityRule.properties.destinationPortRange), securityRule.properties.destinationPortRanges, securityRule.properties.destinationPortRange), sourceAddress = case(isempty(securityRule.properties.sourceAddressPrefix), securityRule.properties.sourceAddressPrefixes, securityRule.properties.sourceAddressPrefix) | where access =~ "Allow" and direction =~ "Inbound" and protocol in~ ("udp", "*") | mv-expand destinationPort | mv-expand sourceAddress | extend destinationPortMin = toint(split(destinationPort, "-")[0]), destinationPortMax = toint(split(destinationPort, "-")[-1]) | where (destinationPortMin <= 53 and destinationPortMax >= 53) or (destinationPortMin <= 123 and destinationPortMax >= 123) or (destinationPortMin <= 161 and destinationPortMax >= 161) or (destinationPortMin <= 389 and destinationPortMax >= 389) or (destinationPortMin <= 1900 and destinationPortMax >= 1900) or destinationPort == "" | where sourceAddress in~ ("*", "0.0.0.0", "internet", "any") or sourceAddress endswith "/0"