turbot/terraform_aws_compliance

Query: elb_lb_use_secure_protocol_listener

Usage

powerpipe query terraform_aws_compliance.query.elb_lb_use_secure_protocol_listener

Steampipe Tables

SQL

select
address as resource,
case
when (attributes_std ->> 'protocol') like any (array ['HTTPS', 'TLS', 'TCP', 'UDP', 'TCP_UDP']) then 'ok'
when (attributes_std -> 'default_action' ->> 'type') = 'redirect' and (attributes_std -> 'default_action' -> 'redirect' ->> 'protocol') = 'HTTPS' then 'ok'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when (attributes_std ->> 'protocol') like any (array ['HTTPS', 'TLS', 'TCP', 'UDP', 'TCP_UDP']) then ' listener configured with ' || (attributes_std ->> 'protocol') || ' secure protocol'
when (attributes_std -> 'default_action' ->> 'type') = 'redirect' and (attributes_std -> 'default_action' -> 'redirect' ->> 'protocol') = 'HTTPS' then ' listener configured with ' || (attributes_std -> 'default_action' ->> 'type') || ' and ' || (attributes_std -> 'default_action' -> 'redirect' ->> 'protocol') || ' secure protocol'
else ' listener not configured with any secured protocol'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type in ('aws_lb_listener', 'aws_alb_listener');

Controls

The query is being used by the following controls: