Ensure UDP Services are restricted from the Internet

Error: UDP Services are not restricted from the Internet

Bridgecrew Policy ID: BC_AZR_NETWORKING_22
Checkov Check ID: CKV_AZURE_77
Severity: HIGH

UDP Services are not restricted from the Internet

Description

Disable Internet exposed UDP ports on network security groups. 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 use exposed DNS, NTP, SSDP, SNMP, CLDAP and other UDP-based services as amplification source for disrupting services of other machines on the Azure Virtual Network or even attack networked devices outside of Azure.

Fix - Buildtime

Terraform

  • Resource: azurerm_network_security_group
  • Argument: protocol
resource "azurerm_network_security_group" "example" {

              security_rule {
                name                       = "test123"
                priority                   = 100
                direction                  = "Inbound"
+               access                     = "Deny"
+               protocol                   = "Udp"
                source_port_range          = "*"
                destination_port_range     = "*"
                source_address_prefix      = "*"
                destination_address_prefix = "*"
              }
								...
            }