turbot/steampipe-mod-terraform-aws-compliance

Control: RDS DB instances should use recent CA certificates

Description

This control checks whether Relational Database Service (RDS) instances use recent CA certificate(s).

Usage

Run the control in your terminal:

powerpipe control run terraform_aws_compliance.control.rds_db_instance_uses_recent_ca_certificate

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run terraform_aws_compliance.control.rds_db_instance_uses_recent_ca_certificate --share

SQL

This control uses a named query:

select
address as resource,
case
when (attributes_std ->> 'ca_cert_identifier') in ('rds-ca-rsa2048-g1', 'rds-ca-rsa4096-g1', 'rds-ca-ecc384-g1') then 'ok'
when (attributes_std ->> 'ca_cert_identifier') is null then 'skip'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when (attributes_std ->> 'ca_cert_identifier') in ('rds-ca-rsa2048-g1', 'rds-ca-rsa4096-g1', 'rds-ca-ecc384-g1') then ' uses recent CA certificate'
when (attributes_std ->> 'ca_cert_identifier') is null then ' CA certificate not defined'
else ' uses an old CA certificate'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'aws_db_instance';

Tags