turbot/steampipe-mod-aws-compliance

Control: ELB application load balancers should have Web Application Firewall (WAF) enabled

Description

Ensure AWS WAF is enabled on Elastic Load Balancers (ELB) to help protect web applications.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.elb_application_lb_waf_enabled

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run aws_compliance.control.elb_application_lb_waf_enabled --share

SQL

This control uses a named query:

select
alb.arn as resource,
case
when waf.web_acl_id is not null or wafv2.id is not null then 'ok'
else 'alarm'
end as status,
case
when waf.web_acl_id is not null or wafv2.id is not null then alb.title || ' WAF enabled.'
else alb.title || ' WAF disabled.'
end as reason
, alb.region, alb.account_id
from aws_ec2_application_load_balancer as alb
left join aws_wafregional_web_acl as waf on waf.resources @> jsonb_build_array(alb.arn)
left join aws_wafv2_web_acl as wafv2 on wafv2.associated_resources @> jsonb_build_array(alb.arn)

Tags