-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlocals.tf
82 lines (81 loc) · 2.51 KB
/
locals.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
locals {
name = format("%s-%s-%s", var.prefix, var.environment, var.name)
tags = merge(
{
"Terraform" = "true"
"Environment" = var.environment,
"Module" = "terraform-aws-waf"
},
var.tags
)
default_rules = [
{
name = "AWSManagedRulesCommonRuleSet",
priority = 10
override_action = "none"
excluded_rules = []
},
{
name = "AWSManagedRulesAmazonIpReputationList",
priority = 20
override_action = "none"
excluded_rules = []
},
{
name = "AWSManagedRulesKnownBadInputsRuleSet",
priority = 30
override_action = "none"
excluded_rules = []
},
{
name = "AWSManagedRulesSQLiRuleSet",
priority = 40
override_action = "none"
excluded_rules = []
},
{
name = "AWSManagedRulesLinuxRuleSet",
priority = 50
override_action = "none"
excluded_rules = []
},
{
name = "AWSManagedRulesUnixRuleSet",
priority = 60
override_action = "none"
excluded_rules = []
}
]
managed_rules = concat(var.is_enable_default_rule ? local.default_rules : [], var.managed_rules)
/* ------------------------------ Custom Rules ------------------------------ */
# unique_dynamic_blocks
size_constraint = "size-constraint"
originate_from_a_country_in = "originate-from-a-country-in"
originate_from_an_ip_addresses_in = "originate-from-an-ip-addresses-in"
has_a_label = "has-a-label"
# byte_match_dynamic_blocks
single_header = "single-header"
# all_headers = "all-headers" ## Not support by this module now
# cookies = "cookies" ## Not support by this module now
single_query_parameter = "single-query-parameter"
all_query_parameters = "all-query-parameters"
uri_path = "uri-path"
query_string = "query-string"
body = "body"
# json_body = "json-body" ## Not support by this module now
http_method = "http-method"
# header_order = "header_order" ## Not support by this module now
request_component_dynamic_blocks = [
local.single_header,
# local.all_headers,
# local.cookies,
local.single_query_parameter,
local.all_query_parameters,
local.uri_path,
local.query_string,
# local.body,
# local.json_body,
local.http_method,
# local.header_order
]
}