turbot/steampipe-mod-terraform-aws-compliance

Control: ELB classic load balancers should use SSL certificates

Description

Because sensitive data can exist and to help protect data at transit, ensure encryption is enabled for your Elastic Load Balancing.

Usage

Run the control in your terminal:

powerpipe control run terraform_aws_compliance.control.elb_classic_lb_use_ssl_certificate

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

select
address as resource,
case
when (attributes_std -> 'listener') is null then 'skip'
when (attributes_std -> 'listener' ->> 'lb_protocol') ilike 'SSL' and (attributes_std -> 'listener' -> 'ssl_certificate_id') is null then 'alarm'
when (attributes_std -> 'listener' ->> 'lb_protocol') ilike 'SSL' and (attributes_std -> 'listener' ->> 'ssl_certificate_id') like 'arn:aws:acm%' then 'ok'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when (attributes_std -> 'listener') is null then ' has no listener'
when (attributes_std -> 'listener' ->> 'lb_protocol') ilike 'SSL' and (attributes_std -> 'listener' -> 'ssl_certificate_id') is null then ' does not use certificate provided by ACM'
when (attributes_std -> 'listener' ->> 'lb_protocol') ilike 'SSL' and (attributes_std -> 'listener' ->> 'ssl_certificate_id') like 'arn:aws:acm%' then ' uses certificates provided by ACM'
else ' does not use certificate provided by ACM'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'aws_elb';

Tags