Control: ELB load balancer listeners should use a secure protocol
Description
Ensure that your load balancer listeners are configured with a secure protocol including redirections.
Usage
Run the control in your terminal:
powerpipe control run terraform_aws_compliance.control.elb_lb_use_secure_protocol_listenerSnapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run terraform_aws_compliance.control.elb_lb_use_secure_protocol_listener --shareSQL
This control uses a named query:
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_linefrom terraform_resourcewhere type in ('aws_lb_listener', 'aws_alb_listener');