Control: Container registries should be encrypted with a customer-managed key
Description
Use customer-managed keys to manage the encryption at rest of the contents of your registries. By default, the data is encrypted at rest with service-managed keys, but customer-managed keys are commonly required to meet regulatory compliance standards. Customer-managed keys enable the data to be encrypted with an Azure Key Vault key created and owned by you. You have full control and responsibility for the key lifecycle, including rotation and management.
Usage
Run the control in your terminal:
powerpipe control run terraform_azure_compliance.control.container_registry_encrypted_with_cmkSnapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run terraform_azure_compliance.control.container_registry_encrypted_with_cmk --shareSQL
This control uses a named query:
select  address as resource,  case    when (attributes_std -> 'encryption' ) is null then 'alarm'    when (attributes_std -> 'encryption' ->> 'enabled')::boolean then 'ok'    else 'alarm'  end status,  split_part(address, '.', 2) || case    when (attributes_std -> 'encryption' ) is null then ' ''encryption'' not defined'    when (attributes_std -> 'encryption' ->> 'enabled')::boolean then ' encrypted with CMK'    else ' not encrypted with CMK'  end || '.' reason    , path || ':' || start_linefrom  terraform_resourcewhere  type = 'azurerm_container_registry';