turbot/terraform_azure_compliance

Query: storage_account_encryption_at_rest_using_cmk

Usage

powerpipe query terraform_azure_compliance.query.storage_account_encryption_at_rest_using_cmk

Steampipe Tables

SQL

select
address as resource,
case
when name in (
select
split_part((attributes_std ->> 'storage_account_id'), '.', 2)
from
terraform_resource
where
type = 'azurerm_storage_account_customer_managed_key'
) then 'ok'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when name in (
select
split_part((attributes_std ->> 'storage_account_id'), '.', 2)
from
terraform_resource
where
type = 'azurerm_storage_account_customer_managed_key'
) then ' encrypted with CMK'
else ' not encrypted with CMK'
end || '.' reason,
path || ':' || start_line
from
terraform_resource
where
type = 'azurerm_storage_account';

Controls

The query is being used by the following controls: