Control: Guest Configuration extension should be installed on your machines
Description
To ensure secure configurations of in-guest settings of your machine, install the Guest Configuration extension. In-guest settings that the extension monitors include the configuration of the operating system, application configuration or presence, and environment settings. Once installed, in-guest policies will be available such as 'Windows Exploit guard should be enabled'.
Usage
Run the control in your terminal:
powerpipe control run terraform_azure_compliance.control.compute_vm_guest_configuration_installedSnapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run terraform_azure_compliance.control.compute_vm_guest_configuration_installed --shareSQL
This control uses a named query:
with all_vm as (  select  *  from    terraform_resource  where    type = 'azurerm_virtual_machine'), vm_extensions as (    select      *    from      terraform_resource    where      type = 'azurerm_virtual_machine_extension'),vm_guest_configuration as (  select    split_part((b.attributes_std ->> 'virtual_machine_id'), '.', 2) as vm_name  from    all_vm as a    left join vm_extensions as b on (split_part((b.attributes_std ->> 'virtual_machine_id'), '.', 2)) = a.name  where    (b.attributes_std ->> 'publisher') = 'Microsoft.GuestConfiguration')select  address as resource,  case    when d.vm_name is null then 'alarm'    else 'ok'  end as status,  split_part(address, '.', 2) || case    when d.vm_name is null then ' have guest configuration extension not installed'    else ' have guest configuration extension installed'  end || '.' reason    , path || ':' || start_linefrom  all_vm as c  left join vm_guest_configuration as d on c.name = d.vm_name;