turbot/terraform_azure_compliance

Query: storage_account_encryption_scopes_encrypted_at_rest_with_cmk

Usage

powerpipe query terraform_azure_compliance.query.storage_account_encryption_scopes_encrypted_at_rest_with_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_encryption_scope'
and (attributes_std ->> 'source') = 'Microsoft.KeyVault'
) 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_encryption_scope'
and (attributes_std ->> 'source') = 'Microsoft.KeyVault'
) 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: