-
Notifications
You must be signed in to change notification settings - Fork 22
/
variables.tf
316 lines (284 loc) · 10.7 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
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
variable "additional_auditing_trail" {
type = object({
name = string
bucket = string
kms_key_id = string
event_selector = optional(object({
data_resource = optional(object({
type = string
values = list(string)
}))
exclude_management_event_sources = optional(set(string), null)
include_management_events = optional(bool, true)
read_write_type = optional(string, "All")
}))
})
default = null
description = "CloudTrail configuration for additional auditing trail"
}
variable "regions" {
type = object({
allowed_regions = list(string)
home_region = string
linked_regions = optional(list(string), ["us-east-1"])
})
description = "Region configuration. See the README for more information on the configuration options."
validation {
condition = length(var.regions.linked_regions) > 0
error_message = "The 'linked_regions' list must include at least one region. By default, 'us-east-1' is specified to ensure the tracking of global resources. Please specify at least one region if overriding the default."
}
}
variable "aws_account_password_policy" {
type = object({
allow_users_to_change = bool
max_age = number
minimum_length = number
require_lowercase_characters = bool
require_numbers = bool
require_symbols = bool
require_uppercase_characters = bool
reuse_prevention_history = number
})
default = {
allow_users_to_change = true
max_age = 90
minimum_length = 14
require_lowercase_characters = true
require_numbers = true
require_symbols = true
require_uppercase_characters = true
reuse_prevention_history = 24
}
description = "AWS account password policy parameters for the audit, logging and master account"
}
variable "aws_auditmanager" {
type = object({
enabled = bool
reports_bucket_prefix = string
})
default = {
enabled = true
reports_bucket_prefix = "audit-manager-reports"
}
description = "AWS Audit Manager config settings"
}
variable "aws_config" {
type = object({
aggregator_account_ids = optional(list(string), [])
delivery_channel_s3_bucket_name = optional(string, null)
delivery_channel_s3_key_prefix = optional(string, null)
delivery_frequency = optional(string, "TwentyFour_Hours")
rule_identifiers = optional(list(string), [])
})
default = {
aggregator_account_ids = []
delivery_channel_s3_bucket_name = null
delivery_channel_s3_key_prefix = null
delivery_frequency = "TwentyFour_Hours"
rule_identifiers = []
}
description = "AWS Config settings"
validation {
condition = contains(["One_Hour", "Three_Hours", "Six_Hours", "Twelve_Hours", "TwentyFour_Hours"], var.aws_config.delivery_frequency)
error_message = "The delivery frequency must be set to \"One_Hour\", \"Three_Hours\", \"Six_Hours\", \"Twelve_Hours\", or \"TwentyFour_Hours\"."
}
}
variable "aws_config_sns_subscription" {
type = map(object({
endpoint = string
protocol = string
}))
default = {}
description = "Subscription options for the aws-controltower-AggregateSecurityNotifications (AWS Config) SNS topic"
}
variable "aws_ebs_encryption_by_default" {
type = bool
default = true
description = "Set to true to enable AWS Elastic Block Store encryption by default"
}
variable "aws_guardduty" {
type = object({
enabled = optional(bool, true)
finding_publishing_frequency = optional(string, "FIFTEEN_MINUTES")
ebs_malware_protection_status = optional(bool, true)
eks_audit_logs_status = optional(bool, true)
lambda_network_logs_status = optional(bool, true)
rds_login_events_status = optional(bool, true)
s3_data_events_status = optional(bool, true)
runtime_monitoring_status = optional(object({
enabled = optional(bool, true)
eks_addon_management_status = optional(bool, true)
ecs_fargate_agent_management_status = optional(bool, true)
ec2_agent_management_status = optional(bool, true)
}), {})
})
default = {}
description = "AWS GuardDuty settings"
}
variable "aws_inspector" {
type = object({
enabled = optional(bool, false)
enable_scan_ec2 = optional(bool, true)
enable_scan_ecr = optional(bool, true)
enable_scan_lambda = optional(bool, true)
enable_scan_lambda_code = optional(bool, true)
resource_create_timeout = optional(string, "15m")
})
default = {
enabled = false
enable_scan_ec2 = true
enable_scan_ecr = true
enable_scan_lambda = true
enable_scan_lambda_code = true
resource_create_timeout = "15m"
}
description = "AWS Inspector settings, at least one of the scan options must be enabled"
}
variable "aws_required_tags" {
type = map(list(object({
name = string
values = optional(list(string))
enforced_for = optional(list(string))
})))
default = null
description = "AWS Required tags settings"
validation {
condition = var.aws_required_tags != null ? alltrue([for taglist in var.aws_required_tags : length(taglist) <= 10]) : true
error_message = "A maximum of 10 tag keys can be supplied to stay within the maximum policy length."
}
}
variable "aws_security_hub" {
type = object({
aggregator_linking_mode = optional(string, "SPECIFIED_REGIONS")
auto_enable_controls = optional(bool, true)
control_finding_generator = optional(string, "SECURITY_CONTROL")
create_cis_metric_filters = optional(bool, true)
disabled_control_identifiers = optional(list(string), null)
enabled_control_identifiers = optional(list(string), null)
product_arns = optional(list(string), [])
standards_arns = optional(list(string), null)
})
default = {}
description = "AWS Security Hub settings"
validation {
condition = contains(["SECURITY_CONTROL", "STANDARD_CONTROL"], var.aws_security_hub.control_finding_generator)
error_message = "The \"control_finding_generator\" variable must be set to either \"SECURITY_CONTROL\" or \"STANDARD_CONTROL\"."
}
validation {
condition = contains(["SPECIFIED_REGIONS", "ALL_REGIONS"], var.aws_security_hub.aggregator_linking_mode)
error_message = "The \"aggregator_linking_mode\" variable must be set to either \"SPECIFIED_REGIONS\" or \"ALL_REGIONS\"."
}
validation {
condition = try(length(var.aws_security_hub.enabled_control_identifiers), 0) == 0 || try(length(var.aws_security_hub.disabled_control_identifiers), 0) == 0
error_message = "Only one of \"enabled_control_identifiers\" or \"disabled_control_identifiers\" variable can be set."
}
}
variable "aws_security_hub_sns_subscription" {
type = map(object({
endpoint = string
protocol = string
}))
default = {}
description = "Subscription options for the LandingZone-SecurityHubFindings SNS topic"
}
variable "aws_service_control_policies" {
type = object({
aws_deny_disabling_security_hub = optional(bool, true)
aws_deny_leaving_org = optional(bool, true)
aws_deny_root_user_ous = optional(list(string), [])
aws_require_imdsv2 = optional(bool, true)
principal_exceptions = optional(list(string), [])
})
default = {}
description = "AWS SCP's parameters to disable required/denied policies, set a list of allowed AWS regions, and set principals that are exempt from the restriction"
}
variable "aws_sso_permission_sets" {
type = map(object({
assignments = list(map(list(string)))
inline_policy = optional(string, null)
managed_policy_arns = optional(list(string), [])
session_duration = optional(string, "PT4H")
}))
default = {}
description = "Map of AWS IAM Identity Center permission sets with AWS accounts and group names that should be granted access to each account"
}
variable "control_tower_account_ids" {
type = object({
audit = string
logging = string
})
description = "Control Tower core account IDs"
}
variable "datadog" {
type = object({
api_key = string
cspm_resource_collection_enabled = optional(bool, false)
enable_integration = bool
extended_resource_collection_enabled = optional(bool, false)
install_log_forwarder = optional(bool, false)
log_collection_services = optional(list(string), [])
log_forwarder_version = optional(string)
metric_tag_filters = optional(map(string), {})
namespace_rules = optional(list(string), [])
site_url = string
})
default = null
description = "Datadog integration options for the core accounts"
}
variable "datadog_excluded_regions" {
type = list(string)
description = "List of regions where metrics collection will be disabled."
default = []
}
variable "kms_key_policy" {
type = list(string)
default = []
description = "A list of valid KMS key policy JSON documents"
}
variable "kms_key_policy_audit" {
type = list(string)
default = []
description = "A list of valid KMS key policy JSON document for use with audit KMS key"
}
variable "kms_key_policy_logging" {
type = list(string)
default = []
description = "A list of valid KMS key policy JSON document for use with logging KMS key"
}
variable "monitor_iam_activity" {
type = bool
default = true
description = "Whether IAM activity should be monitored"
}
variable "monitor_iam_activity_sns_subscription" {
type = map(object({
endpoint = string
protocol = string
}))
default = {}
description = "Subscription options for the LandingZone-IAMActivity SNS topic"
}
variable "path" {
type = string
default = "/"
description = "Optional path for all IAM users, user groups, roles, and customer managed policies created by this module"
}
variable "ses_root_accounts_mail_forward" {
type = object({
domain = string
from_email = string
recipient_mapping = map(any)
dmarc = object({
policy = optional(string)
rua = optional(string)
ruf = optional(string)
})
})
default = null
description = "SES config to receive and forward root account emails"
}
variable "tags" {
type = map(string)
default = {}
description = "Map of tags"
}