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.

Run a free scan

Related Azure rules

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please reload the page.