turbot/steampipe-mod-aws-compliance

Control: WAF global rule group should have at least one rule

Description

This control checks whether WAF global rule group has at least one rule. The control fails if no rules are present within a rule group.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.waf_rule_group_rule_attached

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

select
arn as resource,
case
when activated_rules is null or jsonb_array_length(activated_rules) = 0 then 'alarm'
else 'ok'
end as status,
case
when activated_rules is null or jsonb_array_length(activated_rules) = 0 then title || ' has no attached rules.'
else title || ' has ' || jsonb_array_length(activated_rules) || ' rule(s) attached.'
end as reason
, region, account_id
from
aws_waf_rule_group;

Tags