-
Notifications
You must be signed in to change notification settings - Fork 6
/
variables.tf
183 lines (162 loc) · 7.47 KB
/
variables.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
variable "findings_manager_events_lambda" {
type = object({
name = optional(string, "securityhub-findings-manager-events")
log_level = optional(string, "INFO")
memory_size = optional(number, 256)
timeout = optional(number, 300)
security_group_egress_rules = optional(list(object({
cidr_ipv4 = optional(string)
cidr_ipv6 = optional(string)
description = string
from_port = optional(number, 0)
ip_protocol = optional(string, "-1")
prefix_list_id = optional(string)
referenced_security_group_id = optional(string)
to_port = optional(number, 0)
})), [])
})
default = {}
description = "Findings Manager Lambda settings - Manage Security Hub findings in response to EventBridge events"
validation {
condition = alltrue([for o in var.findings_manager_events_lambda.security_group_egress_rules : (o.cidr_ipv4 != null || o.cidr_ipv6 != null || o.prefix_list_id != null || o.referenced_security_group_id != null)])
error_message = "Although \"cidr_ipv4\", \"cidr_ipv6\", \"prefix_list_id\", and \"referenced_security_group_id\" are all marked as optional, you must provide one of them in order to configure the destination of the traffic."
}
}
variable "findings_manager_trigger_lambda" {
type = object({
name = optional(string, "securityhub-findings-manager-trigger")
log_level = optional(string, "INFO")
memory_size = optional(number, 1024)
timeout = optional(number, 900)
security_group_egress_rules = optional(list(object({
cidr_ipv4 = optional(string)
cidr_ipv6 = optional(string)
description = string
from_port = optional(number, 0)
ip_protocol = optional(string, "-1")
prefix_list_id = optional(string)
referenced_security_group_id = optional(string)
to_port = optional(number, 0)
})), [])
})
default = {}
description = "Findings Manager Lambda settings - Manage Security Hub findings in response to S3 file upload triggers"
validation {
condition = alltrue([for o in var.findings_manager_trigger_lambda.security_group_egress_rules : (o.cidr_ipv4 != null || o.cidr_ipv6 != null || o.prefix_list_id != null || o.referenced_security_group_id != null)])
error_message = "Although \"cidr_ipv4\", \"cidr_ipv6\", \"prefix_list_id\", and \"referenced_security_group_id\" are all marked as optional, you must provide one of them in order to configure the destination of the traffic."
}
}
variable "jira_eventbridge_iam_role_name" {
type = string
default = "SecurityHubFindingsManagerJiraEventBridge"
description = "The name of the role which will be assumed by EventBridge rules for Jira integration"
}
variable "jira_integration" {
type = object({
enabled = optional(bool, false)
autoclose_enabled = optional(bool, false)
autoclose_comment = optional(string, "Security Hub finding has been resolved. Autoclosing the issue.")
autoclose_transition_name = optional(string, "Close Issue")
credentials_secret_arn = string
exclude_account_ids = optional(list(string), [])
finding_severity_normalized_threshold = optional(number, 70)
issue_custom_fields = optional(map(string), {})
issue_type = optional(string, "Security Advisory")
project_key = string
security_group_egress_rules = optional(list(object({
cidr_ipv4 = optional(string)
cidr_ipv6 = optional(string)
description = string
from_port = optional(number, 0)
ip_protocol = optional(string, "-1")
prefix_list_id = optional(string)
referenced_security_group_id = optional(string)
to_port = optional(number, 0)
})), [])
lambda_settings = optional(object({
name = optional(string, "securityhub-findings-manager-jira")
log_level = optional(string, "INFO")
memory_size = optional(number, 256)
timeout = optional(number, 60)
}), {
name = "securityhub-findings-manager-jira"
iam_role_name = "SecurityHubFindingsManagerJiraLambda"
log_level = "INFO"
memory_size = 256
timeout = 60
security_group_egress_rules = []
})
step_function_settings = optional(object({
log_level = optional(string, "ERROR")
retention = optional(number, 90)
}), {
log_level = "ERROR"
retention = 90
})
})
default = {
enabled = false
credentials_secret_arn = null
project_key = null
}
description = "Findings Manager - Jira integration settings"
validation {
condition = alltrue([for o in var.jira_integration.security_group_egress_rules : (o.cidr_ipv4 != null || o.cidr_ipv6 != null || o.prefix_list_id != null || o.referenced_security_group_id != null)])
error_message = "Although \"cidr_ipv4\", \"cidr_ipv6\", \"prefix_list_id\", and \"referenced_security_group_id\" are all marked as optional, you must provide one of them in order to configure the destination of the traffic."
}
}
variable "jira_step_function_iam_role_name" {
type = string
default = "SecurityHubFindingsManagerJiraStepFunction"
description = "The name of the role which will be assumed by AWS Step Function for Jira integration"
}
variable "kms_key_arn" {
type = string
description = "The ARN of the KMS key used to encrypt the resources"
}
# Modify the build-lambda.yaml GitHub action if you modify the allowed versions to ensure a proper zip is created.
variable "lambda_runtime" {
type = string
default = "python3.12"
description = "The version of Python to use for the Lambda functions"
validation {
condition = contains(["python3.11", "python3.12"], var.lambda_runtime)
error_message = "The runtime must be one of the following: python3.11, python3.12."
}
}
variable "rules_filepath" {
type = string
default = ""
description = "Pathname to the file that stores the manager rules"
}
variable "rules_s3_object_name" {
type = string
default = "rules.yaml"
description = "The S3 object containing the rules to be applied to Security Hub findings manager"
}
variable "servicenow_integration" {
type = object({
enabled = optional(bool, false)
create_access_keys = optional(bool, false)
cloudwatch_retention_days = optional(number, 365)
severity_label_filter = optional(list(string), [])
})
default = {
enabled = false
}
description = "ServiceNow integration settings"
}
variable "subnet_ids" {
type = list(string)
default = null
description = "The subnet ids where the Lambda functions needs to run"
}
variable "s3_bucket_name" {
type = string
description = "The name for the S3 bucket which will be created for storing the function's deployment package"
}
variable "tags" {
type = map(string)
default = {}
description = "A mapping of tags to assign to the resources"
}