turbot/aws_insights

Query: kms_key_policy

Usage

powerpipe query aws_insights.query.kms_key_policy

Steampipe Tables

SQL

select
p ->> 'Sid' as "Sid",
p ->> 'Effect' as "Effect",
p -> 'Principal' as "Principal",
p -> 'Action' as "Action",
p -> 'Resource' as "Resource",
p -> 'Condition' as "Condition"
from
aws_kms_key,
jsonb_array_elements(policy_std -> 'Statement') as p
where
arn = $1
and region = split_part($1, ':', 4)
and account_id = split_part($1, ':', 5);