turbot/terraform_gcp_compliance

Query: kms_key_rotated_within_100_day

Usage

powerpipe query terraform_gcp_compliance.query.kms_key_rotated_within_100_day

Steampipe Tables

SQL

select
address as resource,
case
when coalesce((attributes_std ->> 'rotation_period'), '') = '' then 'alarm'
when split_part((attributes_std ->> 'rotation_period'), 's', 1) :: int <= 8640000 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: