forked from nozaq/terraform-aws-secure-baseline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
536 lines (438 loc) · 18.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
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
# --------------------------------------------------------------------------------------------------
# Variables for root module.
# --------------------------------------------------------------------------------------------------
variable "aws_account_id" {
description = "The AWS Account ID number of the account."
}
variable "region" {
description = "The AWS region in which global resources are set up."
}
variable "account_type" {
description = "The type of the AWS account. The possible values are `individual`, `master` and `member` . Specify `master` and `member` to set up centalized logging for multiple accounts in AWS Organization. Use individual` otherwise."
default = "individual"
}
variable "master_account_id" {
description = "The ID of the master AWS account to which the current AWS account is associated. Required if `account_type` is `member`."
default = ""
}
variable "member_accounts" {
description = "A list of IDs and emails of AWS accounts which associated as member accounts."
type = list(object({
account_id = string
email = string
}))
default = []
}
variable "target_regions" {
description = "A list of regions to set up with this module."
default = [
"ap-northeast-1",
"ap-northeast-2",
"ap-northeast-3",
"ap-south-1",
"ap-southeast-1",
"ap-southeast-2",
"ca-central-1",
"eu-central-1",
"eu-north-1",
"eu-west-1",
"eu-west-2",
"eu-west-3",
"sa-east-1",
"us-east-1",
"us-east-2",
"us-west-1",
"us-west-2"
]
}
variable "tags" {
description = "Specifies object tags key and value. This applies to all resources created by this module."
default = {
}
}
# --------------------------------------------------------------------------------------------------
# Variables for audit log bucket configurations.
# --------------------------------------------------------------------------------------------------
variable "audit_log_bucket_name" {
description = "The name of the S3 bucket to store various audit logs."
}
variable "audit_log_bucket_custom_policy_json" {
description = "Override policy for the audit log bucket. Allows addition of extra policies."
default = "{}"
}
variable "audit_log_lifecycle_glacier_transition_days" {
description = "The number of days after log creation when the log file is archived into Glacier."
default = 90
}
variable "audit_log_bucket_force_destroy" {
description = "A boolean that indicates all objects should be deleted from the audit log bucket so that the bucket can be destroyed without error. These objects are not recoverable."
default = false
}
variable "use_external_audit_log_bucket" {
description = "A boolean that indicates whether the specific audit log bucket already exists. Create a new S3 bucket if it is set to false."
default = false
}
# --------------------------------------------------------------------------------------------------
# Variables for iam-baseline module.
# --------------------------------------------------------------------------------------------------
variable "create_password_policy" {
type = bool
description = "Define if the password policy should be created."
default = true
}
variable "create_master_role" {
type = bool
description = "Define if the master role should be created."
default = true
}
variable "create_manager_role" {
type = bool
description = "Define if the manager role should be created."
default = true
}
variable "create_support_role" {
type = bool
description = "Define if the support role should be created."
default = true
}
variable "master_iam_role_name" {
description = "The name of the IAM Master role."
default = "IAM-Master"
}
variable "master_iam_role_policy_name" {
description = "The name of the IAM Master role policy."
default = "IAM-Master-Policy"
}
variable "manager_iam_role_name" {
description = "The name of the IAM Manager role."
default = "IAM-Manager"
}
variable "manager_iam_role_policy_name" {
description = "The name of the IAM Manager role policy."
default = "IAM-Manager-Policy"
}
variable "support_iam_role_name" {
description = "The name of the the support role."
default = "IAM-Support"
}
variable "support_iam_role_policy_name" {
description = "The name of the support role policy."
default = "IAM-Support-Role"
}
variable "support_iam_role_principal_arns" {
type = list(any)
description = "List of ARNs of the IAM principal elements by which the support role could be assumed."
}
variable "max_password_age" {
description = "The number of days that an user password is valid."
default = 0
}
variable "minimum_password_length" {
description = "Minimum length to require for user passwords."
default = 14
}
variable "password_reuse_prevention" {
description = "The number of previous passwords that users are prevented from reusing."
default = 24
}
variable "require_lowercase_characters" {
description = "Whether to require lowercase characters for user passwords."
default = false
}
variable "require_numbers" {
description = "Whether to require numbers for user passwords."
default = false
}
variable "require_uppercase_characters" {
description = "Whether to require uppercase characters for user passwords."
default = false
}
variable "require_symbols" {
description = "Whether to require symbols for user passwords."
default = false
}
variable "allow_users_to_change_password" {
description = "Whether to allow users to change their own password."
default = true
}
# --------------------------------------------------------------------------------------------------
# Variables for vpc-baseline module.
# --------------------------------------------------------------------------------------------------
variable "vpc_enable" {
description = "Boolean whether the VPC baseline module should be enabled"
default = true
}
variable "vpc_iam_role_name" {
description = "The name of the IAM Role which VPC Flow Logs will use."
default = "VPC-Flow-Logs-Publisher"
}
variable "vpc_iam_role_policy_name" {
description = "The name of the IAM Role Policy which VPC Flow Logs will use."
default = "VPC-Flow-Logs-Publish-Policy"
}
variable "vpc_enable_flow_logs" {
description = "The boolean flag whether to enable VPC Flow Logs in default VPCs"
default = true
}
variable "vpc_flow_logs_destination_type" {
description = "The type of the logging destination. Valid values: cloud-watch-logs, s3"
default = "cloud-watch-logs"
}
variable "vpc_flow_logs_log_group_name" {
description = "The name of CloudWatch Logs group to which VPC Flow Logs are delivered."
default = "default-vpc-flow-logs"
}
variable "vpc_flow_logs_retention_in_days" {
description = "Number of days to retain logs if vpc_log_destination_type is cloud-watch-logs. CIS recommends 365 days. Possible values are: 0, 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653. Set to 0 to keep logs indefinitely."
default = 365
}
variable "vpc_flow_logs_s3_arn" {
description = "ARN of the S3 bucket to which VPC Flow Logs are delivered if vpc_log_destination_type is s3."
default = ""
}
variable "vpc_flow_logs_s3_key_prefix" {
description = "The prefix used when VPC Flow Logs delivers logs to the S3 bucket."
default = "flow-logs"
}
# --------------------------------------------------------------------------------------------------
# Variables for config-baseline module.
# --------------------------------------------------------------------------------------------------
variable "config_baseline_enabled" {
description = "Boolean whether config-baseline is enabled."
default = true
}
variable "config_delivery_frequency" {
description = "The frequency which AWS Config sends a snapshot into the S3 bucket."
default = "One_Hour"
}
variable "config_iam_role_name" {
description = "The name of the IAM Role which AWS Config will use."
default = "Config-Recorder"
}
variable "config_iam_role_policy_name" {
description = "The name of the IAM Role Policy which AWS Config will use."
default = "Config-Recorder-Policy"
}
variable "config_s3_bucket_key_prefix" {
description = "The prefix used when writing AWS Config snapshots into the S3 bucket."
default = "config"
}
variable "config_sns_topic_name" {
description = "The name of the SNS Topic to be used to notify configuration changes."
default = "ConfigChanges"
}
variable "config_sns_topic_kms_master_key_id" {
description = "To enable SNS Topic encryption enter value with the ID of a custom master KMS key that is used for encryption"
default = null
}
variable "config_aggregator_name" {
description = "The name of the organizational AWS Config Configuration Aggregator."
default = "organization-aggregator"
}
variable "config_aggregator_name_prefix" {
description = "The prefix of the name for the IAM role attached to the organizational AWS Config Configuration Aggregator."
default = "config-for-organization-role"
}
variable "config_global_resources_all_regions" {
description = "Record global resources in all regions. If false, only default region will record global resources."
default = false
}
# --------------------------------------------------------------------------------------------------
# Variables for cloudtrail-baseline module.
# --------------------------------------------------------------------------------------------------
variable "cloudtrail_cloudwatch_logs_enabled" {
description = "Specifies whether the trail is delivered to CloudWatch Logs."
default = true
}
variable "cloudtrail_cloudwatch_logs_group_name" {
description = "The name of CloudWatch Logs group to which CloudTrail events are delivered."
default = "cloudtrail-multi-region"
}
variable "cloudwatch_logs_retention_in_days" {
description = "Number of days to retain logs for. CIS recommends 365 days. Possible values are: 0, 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653. Set to 0 to keep logs indefinitely."
default = 365
}
variable "cloudtrail_iam_role_name" {
description = "The name of the IAM Role to be used by CloudTrail to delivery logs to CloudWatch Logs group."
default = "CloudTrail-CloudWatch-Delivery-Role"
}
variable "cloudtrail_iam_role_policy_name" {
description = "The name of the IAM Role Policy to be used by CloudTrail to delivery logs to CloudWatch Logs group."
default = "CloudTrail-CloudWatch-Delivery-Policy"
}
variable "cloudtrail_key_deletion_window_in_days" {
description = "Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days. Defaults to 30 days."
default = 10
}
variable "cloudtrail_name" {
description = "The name of the trail."
default = "cloudtrail-multi-region"
}
variable "cloudtrail_sns_topic_enabled" {
description = "Specifies whether the trail is delivered to a SNS topic."
default = true
}
variable "cloudtrail_sns_topic_name" {
description = "The name of the SNS topic to link to the trail."
default = "cloudtrail-multi-region-sns-topic"
}
variable "cloudtrail_s3_key_prefix" {
description = "The prefix used when CloudTrail delivers events to the S3 bucket."
default = "cloudtrail"
}
variable "cloudtrail_s3_object_level_logging_buckets" {
description = "The list of S3 bucket ARNs on which to enable object-level logging."
default = ["arn:aws:s3:::"] # All S3 buckets
}
variable "cloudtrail_dynamodb_event_logging_tables" {
description = "The list of DynamoDB table ARNs on which to enable event logging."
default = ["arn:aws:dynamodb"] # All DynamoDB tables
}
variable "cloudtrail_lambda_invocation_logging_lambdas" {
description = "The list of lambda ARNs on which to enable invocation logging."
default = ["arn:aws:lambda"] # All lambdas
}
# --------------------------------------------------------------------------------------------------
# Variables for alarm-baseline module.
# --------------------------------------------------------------------------------------------------
variable "alarm_namespace" {
description = "The namespace in which all alarms are set up."
default = "CISBenchmark"
}
variable "alarm_sns_topic_name" {
description = "The name of the SNS Topic which will be notified when any alarm is performed."
default = "CISAlarm"
}
variable "alarm_sns_topic_kms_master_key_id" {
description = "To enable SNS Topic encryption enter value with the ID of a custom master KMS key that is used for encryption"
default = null
}
variable "unauthorized_api_calls_enabled" {
description = "The boolean flag whether the unauthorized_api_calls alarm is enabled or not. No resources are created when set to false."
default = true
}
variable "no_mfa_console_signin_enabled" {
description = "The boolean flag whether the no_mfa_console_signin alarm is enabled or not. No resources are created when set to false."
default = true
}
variable "root_usage_enabled" {
description = "The boolean flag whether the root_usage alarm is enabled or not. No resources are created when set to false."
default = true
}
variable "iam_changes_enabled" {
description = "The boolean flag whether the iam_changes alarm is enabled or not. No resources are created when set to false."
default = true
}
variable "cloudtrail_cfg_changes_enabled" {
description = "The boolean flag whether the cloudtrail_cfg_changes alarm is enabled or not. No resources are created when set to false."
default = true
}
variable "console_signin_failures_enabled" {
description = "The boolean flag whether the console_signin_failures alarm is enabled or not. No resources are created when set to false."
default = true
}
variable "disable_or_delete_cmk_enabled" {
description = "The boolean flag whether the disable_or_delete_cmk alarm is enabled or not. No resources are created when set to false."
default = true
}
variable "s3_bucket_policy_changes_enabled" {
description = "The boolean flag whether the s3_bucket_policy_changes alarm is enabled or not. No resources are created when set to false."
default = true
}
variable "aws_config_changes_enabled" {
description = "The boolean flag whether the aws_config_changes alarm is enabled or not. No resources are created when set to false."
default = true
}
variable "security_group_changes_enabled" {
description = "The boolean flag whether the security_group_changes alarm is enabled or not. No resources are created when set to false."
default = true
}
variable "nacl_changes_enabled" {
description = "The boolean flag whether the nacl_changes alarm is enabled or not. No resources are created when set to false."
default = true
}
variable "network_gw_changes_enabled" {
description = "The boolean flag whether the network_gw_changes alarm is enabled or not. No resources are created when set to false."
default = true
}
variable "route_table_changes_enabled" {
description = "The boolean flag whether the route_table_changes alarm is enabled or not. No resources are created when set to false."
default = true
}
variable "vpc_changes_enabled" {
description = "The boolean flag whether the vpc_changes alarm is enabled or not. No resources are created when set to false."
default = true
}
variable "organizations_changes_enabled" {
description = "The boolean flag whether the organizations_changes alarm is enabled or not. No resources are created when set to false."
default = true
}
# --------------------------------------------------------------------------------------------------
# Variables for guardduty-baseline module.
# --------------------------------------------------------------------------------------------------
variable "guardduty_enabled" {
description = "Boolean whether the guardduty-baseline module is enabled or disabled"
default = true
}
variable "guardduty_disable_email_notification" {
description = "Boolean whether an email notification is sent to the accounts."
default = false
}
variable "guardduty_finding_publishing_frequency" {
description = "Specifies the frequency of notifications sent for subsequent finding occurrences."
default = "SIX_HOURS"
}
variable "guardduty_invitation_message" {
description = "Message for invitation."
default = "This is an automatic invitation message from guardduty-baseline module."
}
# --------------------------------------------------------------------------------------------------
# Variables for s3-baseline module.
# --------------------------------------------------------------------------------------------------
variable "s3_block_public_acls" {
description = "Whether Amazon S3 should block public ACLs for buckets in this account. Defaults to true."
default = true
}
variable "s3_block_public_policy" {
description = "Whether Amazon S3 should block public bucket policies for buckets in this account. Defaults to true."
default = true
}
variable "s3_ignore_public_acls" {
description = "Whether Amazon S3 should ignore public ACLs for buckets in this account. Defaults to true."
default = true
}
variable "s3_restrict_public_buckets" {
description = "Whether Amazon S3 should restrict public bucket policies for buckets in this account. Defaults to true."
default = true
}
# --------------------------------------------------------------------------------------------------
# Variables for securityhub-baseline module.
# --------------------------------------------------------------------------------------------------
variable "securityhub_enabled" {
description = "Boolean whether the securityhub-baseline module is enabled or disabled"
default = true
}
variable "securityhub_enable_cis_standard" {
description = "Boolean whether CIS standard is enabled."
default = true
}
variable "securityhub_enable_pci_dss_standard" {
description = "Boolean whether PCI DSS standard is enabled."
default = false
}
variable "securityhub_enable_aws_foundational_standard" {
description = "Boolean whether AWS Foundations standard is enabled."
default = true
}
variable "securityhub_enable_product_arns" {
description = "List of Security Hub product ARNs, `<REGION>` will be replaced. See https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-partner-providers.html for list."
type = list(string)
default = []
}
# --------------------------------------------------------------------------------------------------
# Variables for analyzer-baseline module.
# --------------------------------------------------------------------------------------------------
variable "analyzer_name" {
description = "The name for the IAM Access Analyzer resource to be created."
default = "default-analyzer"
}