turbot/terraform_azure_compliance

Query: kusto_cluster_encrypted_at_rest_with_cmk

Usage

powerpipe query terraform_azure_compliance.query.kusto_cluster_encrypted_at_rest_with_cmk

Steampipe Tables

SQL

with kusto_clusters as (
select
*
from
terraform_resource
where
type = 'azurerm_kusto_cluster'
), kusto_cluster_customer_managed_key as (
select
split_part((attributes_std ->> 'cluster_id'), '.', 2) as cluster_name
from
terraform_resource
where
type = 'azurerm_kusto_cluster_customer_managed_key'
and (attributes_std ->> 'key_vault_id') is not null
and (attributes_std ->> 'key_name') is not null
and (attributes_std ->> 'key_version') is not null
)
select
address as resource,
case
when s.cluster_name is null then 'alarm'
else 'ok'
end as status,
split_part(a.address, '.', 2) || case
when s.cluster_name is null then ' logging disabled'
else ' logging enabled'
end || '.' reason
, a.path || ':' || a.start_line
from
kusto_clusters as a
left join kusto_cluster_customer_managed_key as s on a.name = s.cluster_name;

Controls

The query is being used by the following controls: