turbot/aws_compliance

Query: networkfirewall_firewall_policy_rule_group_not_empty

Usage

powerpipe query aws_compliance.query.networkfirewall_firewall_policy_rule_group_not_empty

SQL

select
arn as resource,
case
when (firewall_policy ->> 'StatefulRuleGroupReferences' is null or jsonb_array_length(firewall_policy -> 'StatefulRuleGroupReferences') = 0)
and (firewall_policy ->> 'StatelessRuleGroupReferences' is null or jsonb_array_length(firewall_policy -> 'StatelessRuleGroupReferences') = 0) then 'alarm'
else 'ok'
end as status,
case
when (firewall_policy ->> 'StatefulRuleGroupReferences' is null or jsonb_array_length(firewall_policy -> 'StatefulRuleGroupReferences') = 0)
and (firewall_policy ->> 'StatelessRuleGroupReferences' is null or jsonb_array_length(firewall_policy -> 'StatelessRuleGroupReferences') = 0) then title || ' has no associated rule groups.'
else title || ' has associated rule groups.'
end as reason
, region, account_id
from
aws_networkfirewall_firewall_policy;

Controls

The query is being used by the following controls: