@@ -158,7 +158,7 @@ def add_waf_blocked_alarm(resources: JSON) -> JSON:
158
158
for rule in resources ['aws_wafv2_web_acl' ]['api_gateway' ]['rule' ]
159
159
if (
160
160
('block' in rule .get ('action' , {}) or 'none' in rule .get ('override_action' , {}))
161
- and rule ['name' ] not in config .waf_block_rules_not_logged
161
+ and rule ['name' ] not in config .waf_rules_not_logged
162
162
)
163
163
]
164
164
metrics = [
@@ -350,9 +350,10 @@ def add_waf_blocked_alarm(resources: JSON) -> JSON:
350
350
'action' : {
351
351
action : {}
352
352
},
353
- # We add a label to requests blocked by IP
354
- # to prevent these requests from being
355
- # logged or tripping WAF alarms.
353
+ # We add a label to these requests to give
354
+ # us the option to exclude them from being
355
+ # logged in the WAF log group. See
356
+ # aws_wafv2_web_acl_logging_configuration
356
357
'rule_label' : {
357
358
'name' : name
358
359
},
@@ -396,9 +397,10 @@ def add_waf_blocked_alarm(resources: JSON) -> JSON:
396
397
'action' : {
397
398
'block' : {}
398
399
},
399
- # We add a label to requests blocked by user
400
- # agent to prevent these requests from being
401
- # logged or tripping WAF alarms.
400
+ # We add a label to these requests to give us
401
+ # the option to exclude them from being logged
402
+ # in the WAF log group. See
403
+ # aws_wafv2_web_acl_logging_configuration
402
404
'rule_label' : {
403
405
'name' : config .blocked_user_agents_regex_term
404
406
},
@@ -666,7 +668,7 @@ def add_waf_blocked_alarm(resources: JSON) -> JSON:
666
668
term
667
669
)
668
670
}
669
- } for term in config .waf_block_rules_not_logged
671
+ } for term in config .waf_rules_not_logged
670
672
]
671
673
]
672
674
]
0 commit comments