Ensure Hyper-V generation uses v2 for Azure Image

LOW

Description

Generation 2 Hyper-V virtual machines have more resource and security features than generation 1 machines, so it is recommended to require version 2. For more information on the resource and security features available in version 2, see the Azure documentation.
References:
https://learn.microsoft.com/en-us/azure/virtual-machines/generation-2
https://learn.microsoft.com/en-us/windows-hardware/design/device-experiences/oem-vbs

Remediation

In Terraform -

  1. In the azurerm_image resource, set hyper_v_generation to v2.

References:
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/image

Policy Details

Rule Reference ID: AC_AZURE_0172
CSP: Azure
Remediation Available: Yes
Resource: azurerm_image
Resource Category: Compute
Resource Type: Image

Frameworks