turbot/aws_compliance

Query: rds_db_instance_ca_certificate_expires_7_days

Usage

powerpipe query aws_compliance.query.rds_db_instance_ca_certificate_expires_7_days

Steampipe Tables

SQL

select
arn as resource,
case
when extract(day from (to_timestamp(certificate ->> 'ValidTill','YYYY-MM-DDTHH:MI:SS')) - current_timestamp) <= '7' then 'alarm'
else 'ok'
end as status,
title || ' expires ' || to_char(to_timestamp(certificate ->> 'ValidTill','YYYY-MM-DDTHH:MI:SS'), 'DD-Mon-YYYY') ||
' (' || extract(day from (to_timestamp(certificate ->> 'ValidTill','YYYY-MM-DDTHH:MI:SS')) - current_timestamp) || ' days).'
as reason
, region, account_id
from
aws_rds_db_instance;

Controls

The query is being used by the following controls: