Control: Virtual machines should not allow extension operations
Description
Virtual machines should not allow extension operations to prevent unauthorized users from adding extensions to virtual machines.
Usage
Run the control in your terminal:
powerpipe control run terraform_azure_compliance.control.compute_vm_allow_extension_operations_disabled
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run terraform_azure_compliance.control.compute_vm_allow_extension_operations_disabled --share
SQL
This control uses a named query:
select address as resource, case when (attributes_std ->> 'allow_extension_operations')::boolean or (attributes_std ->> 'allow_extension_operations') is null then 'alarm' else 'ok' end status, split_part(address, '.', 2) || case when (attributes_std ->> 'allow_extension_operations')::boolean or (attributes_std ->> 'allow_extension_operations') is null then ' allow extension operations' else ' disallow extension operations' end || '.' reason , path || ':' || start_linefrom terraform_resourcewhere type in ('azurerm_linux_virtual_machine', 'azurerm_windows_virtual_machine');