-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwaf.tf
871 lines (835 loc) · 26.7 KB
/
waf.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
## Priorities:
# 0: limit_search_requests_by_countries
# 1-9: block_uri_path_string
# 10-19: block_articles
# 20-29: block_regex_pattern
# 30-39 free
# 40: whitelisted_ips_v4
# 41: whitelisted_ips_v6
# 42: Rate_limit_everything_apart_from_CH
# 43: count_requests_from_ch
# 44: whitelist_based_on_headers
# 45-49: free
# 50-59: AWS Managed rule groups (these are the ones that only count and label requests)
# 60: AWS managed rule labels rate limit
# 70-79: country_rates
# 80: everybody_else_limit
# 90: country_count_rules
locals {
everybody_else_exclude_country_codes = distinct(flatten([ # find all the country_codes mentioned in our rules
for rules in var.country_rates : [rules.country_codes]
]))
country_rate_chunks = chunklist(var.country_rates, 4)
country_rate_chunks_map = zipmap(
range(length(local.country_rate_chunks)),
local.country_rate_chunks
)
group_whitelist_ipv6 = compact(concat(
var.whitelisted_ips_v6,
local.google_bots_ipv6, # empty if enable_google_bots_whitelist is set to false
))
group_whitelist_ipv4 = compact(concat(
var.whitelisted_ips_v4,
local.google_bots_ipv4, # empty if enable_google_bots_whitelist is set to false
local.parsely_crawlers, # empty if enable_parsely_crawlers_whitelist is set to false
local.k6_load_generators_ipv4, # empty if enable_k6_whitelist is set to false
))
rate_limit_response_key = "rate-limit-error"
custom_response_body = <<MULTILINE
<div style="font-family: Arial, sans-serif;text-align: center; padding: 50px; background-color: #f4f4f4;">
<div style="background-color: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); display: inline-block; max-width: 600px; margin: auto;">
<img src="${var.logo_path}" alt="Company Logo" style="width: 150px; margin-bottom: 20px;">
<h1 style="color: #e74c3c;">HTTP Error 429 - Too many requests</h1>
<p style="color: #555;">Your device sent us too many requests in the past 5 minutes. Please wait a few minutes before retrying.</p>
<p style="color: #888; font-size: 0.9em;">Info: Using VPNs, proxies or public wifi might affect negatively your experience. If you are using one, please try to disable it to see if the problem persists.</p>
<br/>
<p style="color: #333; margin-top: 20px;">If, instead, you believe you have been blocked by accident, please report with a screenshot and a quick summary of what you were trying to visit. This will greatly help us improving our protection systems.</p>
</div>
</div>
MULTILINE
}
resource "aws_wafv2_ip_set" "whitelisted_ips_v4" {
count = length(local.group_whitelist_ipv4) > 0 ? 1 : 0
name = "whitelisted_ips_v4"
scope = var.waf_scope
ip_address_version = "IPV4"
addresses = local.group_whitelist_ipv4
}
resource "aws_wafv2_ip_set" "whitelisted_ips_v6" {
count = length(local.group_whitelist_ipv6) > 0 ? 1 : 0
name = "whitelisted_ips_v6"
scope = var.waf_scope
ip_address_version = "IPV6"
addresses = local.group_whitelist_ipv6
}
resource "aws_wafv2_regex_pattern_set" "string" {
for_each = var.block_regex_pattern
name = each.key
description = each.value.description
scope = var.waf_scope
regular_expression {
regex_string = each.value.regex_string
}
}
resource "aws_wafv2_web_acl" "waf" {
name = var.waf_name
scope = var.waf_scope
default_action {
allow {}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = var.waf_name
sampled_requests_enabled = true
}
custom_response_body {
key = local.rate_limit_response_key
content = local.custom_response_body
content_type = "TEXT_HTML"
}
dynamic "rule" {
for_each = length(local.group_whitelist_ipv4) == 0 ? [] : [1]
content {
name = "whitelisted_ips_v4"
priority = 40
action {
allow {}
}
statement {
ip_set_reference_statement {
arn = aws_wafv2_ip_set.whitelisted_ips_v4[0].arn
dynamic "ip_set_forwarded_ip_config" {
for_each = var.waf_scope == "REGIONAL" ? [1] : []
content {
header_name = "X-Forwarded-For"
fallback_behavior = "MATCH"
position = "ANY" # https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/wafv2_web_acl#position
}
}
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = "whitelisted_ips_v4"
sampled_requests_enabled = true
}
}
}
dynamic "rule" {
for_each = length(local.group_whitelist_ipv6) == 0 ? [] : [1]
content {
name = "whitelisted_ips_v6"
priority = 41
action {
allow {}
}
statement {
ip_set_reference_statement {
arn = aws_wafv2_ip_set.whitelisted_ips_v6[0].arn
dynamic "ip_set_forwarded_ip_config" {
for_each = var.waf_scope == "REGIONAL" ? [1] : []
content {
header_name = "X-Forwarded-For"
fallback_behavior = "MATCH"
position = "ANY" # https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/wafv2_web_acl#position
}
}
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = "whitelisted_ips_v6"
sampled_requests_enabled = true
}
}
}
# This rule is meant to be a failsafe switch in case of attack
# Change "count" to "block" in the console if you are under attack and want to
# rate limit to a low number of requests every country except Switzerland
rule {
name = "rate_limit_everything_apart_from_CH"
priority = 42
action {
count {}
}
statement {
rate_based_statement {
aggregate_key_type = "IP"
limit = 300
scope_down_statement {
not_statement {
statement {
geo_match_statement {
country_codes = ["CH"]
dynamic "forwarded_ip_config" {
for_each = var.waf_scope == "REGIONAL" ? [1] : []
content {
header_name = "X-Forwarded-For"
fallback_behavior = "MATCH"
}
}
}
}
}
}
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = "rate_limit_everything_apart_from_CH"
sampled_requests_enabled = true
}
}
dynamic "rule" {
for_each = var.count_requests_from_ch ? [1] : []
content {
name = "Switzerland"
priority = 43
action {
count {}
}
statement {
geo_match_statement {
country_codes = ["CH"]
dynamic "forwarded_ip_config" {
for_each = var.waf_scope == "REGIONAL" ? [1] : []
content {
header_name = "X-Forwarded-For"
fallback_behavior = "MATCH"
}
}
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = "Switzerland"
sampled_requests_enabled = true
}
}
}
dynamic "rule" {
for_each = var.whitelisted_headers != null ? [1] : []
content {
name = "Whitelist_based_on_headers"
priority = 44
action {
allow {}
}
dynamic "statement" {
# or_statement needs 2 arguments so handle the case when only one article is in the rule
for_each = length(var.whitelisted_headers.headers) > 1 ? [1] : [] # if more than one element use or_statement
content {
or_statement {
dynamic "statement" {
for_each = var.whitelisted_headers.headers
content {
byte_match_statement {
positional_constraint = var.whitelisted_headers.string_match_type
search_string = statement.value
field_to_match {
single_header {
name = lower(statement.key)
}
}
text_transformation {
priority = 0
type = "NONE"
}
}
}
}
}
}
}
dynamic "statement" {
# or_statement needs 2 arguments so handle the case when only one article is in the rule
for_each = length(var.whitelisted_headers.headers) == 1 ? var.whitelisted_headers.headers : {} # if more than one element use or_statement
content {
byte_match_statement {
positional_constraint = var.whitelisted_headers.string_match_type
search_string = statement.value
field_to_match {
single_header {
name = lower(statement.key)
}
}
text_transformation {
priority = 0
type = "NONE"
}
}
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = "Whitelisted_headers"
sampled_requests_enabled = true
}
}
}
dynamic "rule" {
for_each = var.aws_managed_rule_groups
content {
name = rule.value.name
priority = rule.value.priority
override_action {
count {} # valid blocks: count or none
}
statement {
managed_rule_group_statement {
name = rule.value.name
vendor_name = "AWS"
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = rule.value.name
sampled_requests_enabled = true
}
}
}
dynamic "rule" {
for_each = var.everybody_else_limit == 0 ? [] : [1]
content {
name = "Everybody_else"
priority = 80
action {
block {
custom_response {
custom_response_body_key = local.rate_limit_response_key
response_code = 429
}
}
}
statement {
rate_based_statement {
aggregate_key_type = "IP"
limit = var.everybody_else_limit
scope_down_statement {
not_statement {
statement {
geo_match_statement {
country_codes = local.everybody_else_exclude_country_codes
dynamic "forwarded_ip_config" {
for_each = var.waf_scope == "REGIONAL" ? [1] : []
content {
header_name = "X-Forwarded-For"
fallback_behavior = "MATCH"
}
}
}
}
}
}
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = "Everybody_else"
sampled_requests_enabled = true
}
}
}
dynamic "rule" {
for_each = length(var.limit_search_requests_by_countries.country_codes) > 0 ? [1] : []
content {
name = "limit_search_requests_by_countries"
priority = 0
action {
block {
custom_response {
custom_response_body_key = local.rate_limit_response_key
response_code = 429
}
}
}
statement {
rate_based_statement {
aggregate_key_type = "IP"
limit = var.limit_search_requests_by_countries.limit
scope_down_statement {
and_statement {
statement {
byte_match_statement {
positional_constraint = "STARTS_WITH"
search_string = "/search"
field_to_match {
uri_path {}
}
text_transformation {
priority = 0
type = "NONE"
}
}
}
statement {
not_statement {
statement {
geo_match_statement {
country_codes = var.limit_search_requests_by_countries.country_codes
dynamic "forwarded_ip_config" {
for_each = var.waf_scope == "REGIONAL" ? [1] : []
content {
header_name = "X-Forwarded-For"
fallback_behavior = "MATCH"
}
}
}
}
}
}
}
}
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = "limit_search_requests_by_countries"
sampled_requests_enabled = true
}
}
}
dynamic "rule" {
for_each = var.block_uri_path_string
content {
name = rule.value.name
priority = rule.value.priority
action {
block {}
}
statement {
byte_match_statement {
positional_constraint = rule.value.positional_constraint
search_string = rule.value.search_string
field_to_match {
uri_path {}
}
text_transformation {
priority = 0
type = "NONE"
}
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = rule.value.name
sampled_requests_enabled = true
}
}
}
dynamic "rule" {
for_each = var.block_articles
content {
name = rule.value.name
priority = rule.value.priority
action {
block {}
}
statement {
and_statement {
statement {
geo_match_statement {
country_codes = rule.value.country_codes
dynamic "forwarded_ip_config" {
for_each = var.waf_scope == "REGIONAL" ? [1] : []
content {
header_name = "X-Forwarded-For"
fallback_behavior = "MATCH"
}
}
}
}
dynamic "statement" {
# or_statement needs 2 arguments so handle the case when only one article is in the rule
for_each = length(rule.value.articles) > 1 ? [1] : [] # if more than one element use or_statement
content {
or_statement {
dynamic "statement" {
for_each = rule.value.articles
content {
byte_match_statement {
positional_constraint = "ENDS_WITH"
search_string = statement.value
field_to_match {
uri_path {}
}
text_transformation {
priority = 0
type = "NONE"
}
}
}
}
}
}
}
dynamic "statement" {
# or_statement needs 2 arguments so handle the case when only one article is in the rule
for_each = length(rule.value.articles) == 1 ? rule.value.articles : [] # if just one element skip or_statement
content {
byte_match_statement {
positional_constraint = "ENDS_WITH"
search_string = statement.value
field_to_match {
uri_path {}
}
text_transformation {
priority = 0
type = "NONE"
}
}
}
}
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = rule.value.name
sampled_requests_enabled = true
}
}
}
dynamic "rule" {
for_each = var.block_regex_pattern
content {
name = rule.key
priority = rule.value.priority
action {
block {}
}
statement {
and_statement {
statement {
geo_match_statement {
country_codes = rule.value.country_codes
dynamic "forwarded_ip_config" {
for_each = var.waf_scope == "REGIONAL" ? [1] : []
content {
header_name = "X-Forwarded-For"
fallback_behavior = "MATCH"
}
}
}
}
statement {
regex_pattern_set_reference_statement {
arn = aws_wafv2_regex_pattern_set.string[rule.key].arn
field_to_match {
uri_path {}
}
text_transformation {
priority = 1
type = "NONE"
}
}
}
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = rule.key
sampled_requests_enabled = true
}
}
}
rule {
name = "aws_managed_rule_labels"
priority = 60
override_action {
none {}
}
statement {
rule_group_reference_statement {
arn = aws_wafv2_rule_group.aws_managed_rule_labels.arn
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = "aws_managed_rule_labels"
sampled_requests_enabled = true
}
}
dynamic "rule" {
for_each = aws_wafv2_rule_group.country_rate_rules
content {
name = "country_rate_rules_${rule.key}"
priority = 70 + tonumber(rule.key)
override_action {
none {}
}
statement {
rule_group_reference_statement {
arn = rule.value.arn
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = "country_rate_rules_${rule.key}"
sampled_requests_enabled = true
}
}
}
dynamic "rule" {
for_each = length(var.country_count_rules) > 0 ? [1] : [0]
content {
name = "country_count_rules"
priority = 90
override_action {
none {}
}
statement {
rule_group_reference_statement {
arn = try(aws_wafv2_rule_group.country_count_rules[0].arn, "")
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = "country_count_rules"
sampled_requests_enabled = true
}
}
}
}
resource "aws_wafv2_rule_group" "country_rate_rules" {
for_each = local.country_rate_chunks_map
name = "country_rate_rules_${each.key}"
scope = var.waf_scope
capacity = 50
custom_response_body {
key = local.rate_limit_response_key
content = local.custom_response_body
content_type = "TEXT_HTML"
}
dynamic "rule" {
for_each = each.value
content {
name = rule.value.name
priority = rule.value.priority
action {
dynamic "block" {
for_each = rule.value.action == "block" ? [1] : []
content {
custom_response {
custom_response_body_key = local.rate_limit_response_key
response_code = 429
}
}
}
dynamic "captcha" {
for_each = rule.value.action == "captcha" ? [1] : []
content {}
}
dynamic "challenge" {
for_each = rule.value.action == "challenge" ? [1] : []
content {}
}
}
dynamic "captcha_config" {
for_each = rule.value.action == "captcha" ? [1] : []
content {
immunity_time_property {
immunity_time = rule.value.immunity_seconds
}
}
}
statement {
rate_based_statement {
aggregate_key_type = "IP"
limit = rule.value.limit
scope_down_statement {
geo_match_statement {
country_codes = rule.value.country_codes
dynamic "forwarded_ip_config" {
for_each = var.waf_scope == "REGIONAL" ? [1] : []
content {
header_name = "X-Forwarded-For"
fallback_behavior = "MATCH"
}
}
}
}
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = rule.value.name
sampled_requests_enabled = true
}
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = "country_rate_rules"
sampled_requests_enabled = true
}
}
resource "aws_wafv2_rule_group" "aws_managed_rule_labels" {
name = "aws_managed_rule_labels"
scope = var.waf_scope
capacity = 50
custom_response_body {
key = local.rate_limit_response_key
content = local.custom_response_body
content_type = "TEXT_HTML"
}
dynamic "rule" {
for_each = var.aws_managed_rule_labels
content {
name = rule.value.name
priority = rule.value.priority
action {
dynamic "block" {
for_each = rule.value.action == "block" ? [1] : []
content {
custom_response {
custom_response_body_key = local.rate_limit_response_key
response_code = 429
}
}
}
dynamic "captcha" {
for_each = rule.value.action == "captcha" ? [1] : []
content {}
}
dynamic "challenge" {
for_each = rule.value.action == "challenge" ? [1] : []
content {}
}
}
dynamic "captcha_config" {
for_each = rule.value.action == "captcha" ? [1] : []
content {
immunity_time_property {
immunity_time = rule.value.immunity_seconds
}
}
}
# dynamic "challenge_config" {
# # available in the console but seems to be not supported on tf (?)
# # even if is mentioned in the docs https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/wafv2_web_acl#challenge_config-block
# # and is in an open issue https://github.com/hashicorp/terraform-provider-aws/issues/29071
# for_each = rule.value.action == "challenge" ? [1] : []
# content {
# immunity_time_property {
# immunity_time = rule.value.immunity_seconds
# }
# }
# }
statement {
dynamic "or_statement" {
# or_statement needs 2 arguments so handle the case when only one label is in the rule
for_each = length(rule.value.labels) > 1 && !rule.value.enable_rate_limiting ? [1] : []
# if rate limiting is not enabled and more than one element use or_statement
content {
dynamic "statement" {
for_each = rule.value.labels
content {
label_match_statement {
key = statement.value
scope = "LABEL"
}
}
}
}
}
dynamic "label_match_statement" {
# or_statement needs 2 arguments so handle the case when only one label is in the rule
for_each = length(rule.value.labels) == 1 && !rule.value.enable_rate_limiting ? rule.value.labels : []
# if rate limiting is not enabled and one element skip or_statement
content {
key = label_match_statement.value
scope = "LABEL"
}
}
dynamic "rate_based_statement" {
for_each = rule.value.enable_rate_limiting ? [1] : [] # create rate_based_statement only if rate limiting is enabled
content {
aggregate_key_type = "IP"
limit = rule.value.limit
dynamic "scope_down_statement" {
# or_statement needs 2 arguments so handle the case when only one label is in the rule
for_each = length(rule.value.labels) > 1 ? [1] : [] # if more than one element use or_statement
content {
or_statement {
dynamic "statement" {
for_each = rule.value.labels
content {
label_match_statement {
scope = "LABEL"
key = statement.value
}
}
}
}
}
}
dynamic "scope_down_statement" {
# or_statement needs 2 arguments so handle the case when only one label is in the rule
for_each = length(rule.value.labels) == 1 ? rule.value.labels : [] # if one element skip or_statement
content {
label_match_statement {
scope = "LABEL"
key = scope_down_statement.value
}
}
}
}
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = rule.value.name
sampled_requests_enabled = true
}
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = "aws_managed_rule_labels"
sampled_requests_enabled = true
}
}
resource "aws_wafv2_rule_group" "country_count_rules" {
count = length(var.country_count_rules) > 0 ? 1 : 0
name = "country_count_rules"
scope = var.waf_scope
capacity = 100
dynamic "rule" {
for_each = var.country_count_rules
content {
name = rule.value.name
priority = rule.value.priority
action {
count {}
}
statement {
rate_based_statement {
aggregate_key_type = "IP"
limit = rule.value.limit
scope_down_statement {
geo_match_statement {
country_codes = rule.value.country_codes
dynamic "forwarded_ip_config" {
for_each = var.waf_scope == "REGIONAL" ? [1] : []
content {
header_name = "X-Forwarded-For"
fallback_behavior = "MATCH"
}
}
}
}
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = rule.value.name
sampled_requests_enabled = true
}
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = "country_count_rules"
sampled_requests_enabled = true
}
}