turbot/terraform_gcp_compliance

Query: kms_key_rotated_within_90_day

Usage

powerpipe query terraform_gcp_compliance.query.kms_key_rotated_within_90_day

Steampipe Tables

SQL

select
address as resource,
case
when coalesce((attributes_std ->> 'rotation_period'), '') = '' then 'alarm'
when split_part(coalesce((attributes_std ->> 'rotation_period'), ''), 's', 1) :: int <= 7776000 then 'ok'
else 'alarm'
end as status,
split_part(address, '.', 2) || case
when coalesce((attributes_std ->> 'rotation_period'), '') = '' then ' requires manual rotation'
else ' rotation period set for ' || (split_part((attributes_std ->> 'rotation_period'), 's', 1) :: int)/86400 || ' day(s)'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'google_kms_crypto_key';

Controls

The query is being used by the following controls: