turbot/steampipe-mod-aws-compliance

Control: WAF regional rule group should have at least one rule attached

Description

This control checks if WAF regional rule groups contain any rules. The rule is non-compliant if there are no rules present within a WAF regional rule group.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.waf_regional_rule_group_rule_attached

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run aws_compliance.control.waf_regional_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_wafregional_rule_group;

Tags