DDoS Protection Plan should be associated with virtual networks
High
Azure
General
ddosprotectionplans-ddos-protection
Applies to
Microsoft.Network/ddosProtectionPlans
What CGPulse checks
A resource passes this rule when virtualNetworksCount must be greater than 0. Anything else is reported as a finding with the evaluated property value attached as evidence.
How to fix it
Enable DDoS protection to defend VNets against volumetric attacks. In Azure Portal: DDoS Protection Plan > associate with virtual networks. See: https://learn.microsoft.com/en-us/azure/ddos-protection/manage-ddos-protection
CLI
az network vnet update --ids "/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Network/virtualNetworks/{vnet}" --ddos-protection-plan "{id}"Bicep
resource vnet 'Microsoft.Network/virtualNetworks@2023-09-01' = {
name: '{vnetName}'
location: location
properties: {
ddosProtectionPlan: {
id: '{id}'
}
enableDdosProtection: true
addressSpace: {
addressPrefixes: ['10.0.0.0/16']
}
}
}
Terraform
resource "azurerm_network_ddos_protection_plan" "{name}" {
name = "{name}"
resource_group_name = "{rg}"
location = var.location
}
resource "azurerm_virtual_network" "{name}" {
name = "{vnetName}"
resource_group_name = "{rg}"
location = var.location
address_space = ["10.0.0.0/16"]
ddos_protection_plan {
id = azurerm_network_ddos_protection_plan.{name}.id
enable = true
}
}
Compliance frameworks
Is your environment compliant with this rule?
CGPulse checks it — and 621 others — against your Azure and AWS accounts with read-only access.
Related Azure rules
- Action Group should be enabled
- Activity Log Alert should be enabled
- AKS cluster logs should be sent to Log Analytics
- AKS cluster must enable RBAC
- AKS cluster must enable RBAC
- AKS cluster should be a private cluster
- AKS cluster should disable local accounts
- AKS cluster should enable Azure RBAC for Kubernetes