turbot/steampipe-mod-aws-compliance

Control: WAF global rule should have at least one condition

Description

This control checks whether an AWS WAF global 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_rule_condition_attached

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run aws_compliance.control.waf_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) || ' attached conditions.'
end as reason
, region, account_id
from
aws_waf_rule;

Tags