turbot/steampipe-mod-aws-compliance

Control: WAF regional rule should have at least one condition

Description

This control checks whether WAF regional rule contains any conditions. The control fails if no conditions are present within a rule.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.waf_regional_rule_condition_attached

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

select
rule_id as resource,
case
when predicates is null or jsonb_array_length(predicates) = 0 then 'alarm'
else 'ok'
end as status,
case
when predicates is null or jsonb_array_length(predicates) = 0 then title || ' has no attached conditions.'
else title || ' has ' || jsonb_array_length(predicates) || ' condition(s) attached.'
end as reason
, region, account_id
from
aws_wafregional_rule;

Tags