turbot/steampipe-mod-aws-compliance

Control: AWS WAF rules should have CloudWatch metrics enabled

Description

This control checks whether an AWS WAF rule or rule group has Amazon CloudWatch metrics enabled. The control fails if the rule or rule group doesn't have CloudWatch metrics enabled.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.wafv2_rule_group_logging_enabled

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

select
arn as resource,
case
when (visibility_config ->> 'CloudWatchMetricsEnabled')::bool then 'ok'
else 'alarm'
end as status,
case
when (visibility_config ->> 'CloudWatchMetricsEnabled')::bool then title || ' logging enabled.'
else title || ' logging disabled.'
end as reason
, region, account_id
from
aws_wafv2_rule_group;

Tags