turbot/gcp_insights

Query: kms_keys_for_compute_disk

Usage

powerpipe query gcp_insights.query.kms_keys_for_compute_disk

SQL

select
k.self_link
from
gcp_compute_disk d,
gcp_kms_key k
where
d.disk_encryption_key is not null
and k.self_link like '%' || split_part(d.disk_encryption_key ->> 'kmsKeyName', '/cryptoKeyVersions/', 1)
and d.id = (split_part($1, '/', 1))::bigint
and d.project = split_part($1, '/', 2);