forked from nozaq/terraform-aws-secure-baseline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
650 lines (541 loc) · 21.4 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
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
# --------------------------------------------------------------------------------------------------
# Variables for root module.
# --------------------------------------------------------------------------------------------------
variable "aws_account_id" {
description = "The AWS Account ID number of the account."
type = string
}
variable "region" {
description = "The AWS region in which global resources are set up."
type = string
}
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."
type = string
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`."
type = string
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 "permissions_boundary_arn" {
description = "The permissions boundary ARN for all IAM Roles, provisioned by this module"
type = string
default = ""
}
variable "target_regions" {
description = "A list of regions to set up with this module."
type = list(string)
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."
type = map(string)
default = {
}
}
# --------------------------------------------------------------------------------------------------
# Variables for audit log bucket configurations.
# --------------------------------------------------------------------------------------------------
variable "audit_log_bucket_name" {
description = "The name of the S3 bucket to store various audit logs."
type = string
}
variable "audit_log_bucket_access_logs_name" {
description = "The name of the S3 bucket to store various audit logs."
type = string
default = ""
}
variable "audit_log_bucket_custom_policy_json" {
description = "Override policy for the audit log bucket. Allows addition of extra policies."
type = string
default = "{}"
}
variable "audit_log_bucket_key_enabled" {
description = "Whether or not to use Amazon S3 Bucket Keys for encrypting the audit log bucket."
type = bool
default = false
}
variable "audit_log_lifecycle_glacier_transition_days" {
description = "The number of days after log creation when the log file is archived into Glacier. Setting to zero disables the transition."
type = number
default = 0
}
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."
type = bool
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."
type = bool
default = false
}
# --------------------------------------------------------------------------------------------------
# Variables for iam-baseline module.
# --------------------------------------------------------------------------------------------------
variable "iam_baseline_enabled" {
description = "Boolean whether iam-baseline is enabled."
type = bool
default = true
}
variable "create_password_policy" {
description = "Define if the password policy should be created."
type = bool
default = true
}
variable "create_support_role" {
description = "Define if the support role should be created."
type = bool
default = true
}
variable "support_iam_role_name" {
description = "The name of the the support role."
type = string
default = "IAM-Support"
}
variable "support_iam_role_principal_arns" {
type = list(string)
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."
type = number
default = 0
}
variable "minimum_password_length" {
description = "Minimum length to require for user passwords."
type = number
default = 14
}
variable "password_reuse_prevention" {
description = "The number of previous passwords that users are prevented from reusing."
type = number
default = 24
}
variable "require_lowercase_characters" {
description = "Whether to require lowercase characters for user passwords."
type = bool
default = true
}
variable "require_numbers" {
description = "Whether to require numbers for user passwords."
type = bool
default = true
}
variable "require_uppercase_characters" {
description = "Whether to require uppercase characters for user passwords."
type = bool
default = true
}
variable "require_symbols" {
description = "Whether to require symbols for user passwords."
type = bool
default = true
}
variable "allow_users_to_change_password" {
description = "Whether to allow users to change their own password."
type = bool
default = true
}
# --------------------------------------------------------------------------------------------------
# Variables for vpc-baseline module.
# --------------------------------------------------------------------------------------------------
variable "vpc_enable" {
description = "Boolean whether the VPC baseline module should be enabled"
type = bool
default = true
}
variable "vpc_iam_role_name" {
description = "The name of the IAM Role which VPC Flow Logs will use."
type = string
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."
type = string
default = "VPC-Flow-Logs-Publish-Policy"
}
variable "vpc_enable_flow_logs" {
description = "The boolean flag whether to enable VPC Flow Logs in default VPCs"
type = bool
default = true
}
variable "vpc_flow_logs_destination_type" {
description = "The type of the logging destination. Valid values: cloud-watch-logs, s3"
type = string
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."
type = string
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."
type = number
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."
type = string
default = ""
}
variable "vpc_flow_logs_s3_key_prefix" {
description = "The prefix used when VPC Flow Logs delivers logs to the S3 bucket."
type = string
default = "flow-logs"
}
# --------------------------------------------------------------------------------------------------
# Variables for config-baseline module.
# --------------------------------------------------------------------------------------------------
variable "config_baseline_enabled" {
description = "Boolean whether config-baseline is enabled."
type = bool
default = true
}
variable "config_delivery_frequency" {
description = "The frequency which AWS Config sends a snapshot into the S3 bucket."
type = string
default = "One_Hour"
}
variable "config_iam_role_name" {
description = "The name of the IAM Role which AWS Config will use."
type = string
default = "Config-Recorder"
}
variable "config_iam_role_policy_name" {
description = "The name of the IAM Role Policy which AWS Config will use."
type = string
default = "Config-Recorder-Policy"
}
variable "config_s3_bucket_key_prefix" {
description = "The prefix used when writing AWS Config snapshots into the S3 bucket."
type = string
default = "config"
}
variable "config_sns_topic_name" {
description = "The name of the SNS Topic to be used to notify configuration changes."
type = string
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"
type = string
default = null
}
variable "config_aggregator_name" {
description = "The name of the organizational AWS Config Configuration Aggregator."
type = string
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."
type = string
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."
type = bool
default = false
}
# --------------------------------------------------------------------------------------------------
# Variables for cloudtrail-baseline module.
# --------------------------------------------------------------------------------------------------
variable "cloudtrail_baseline_enabled" {
description = "Boolean whether cloudtrail-baseline is enabled."
type = bool
default = true
}
variable "turn_off_organization_trail" {
description = "Specifies whether the disable the organization trail. Organization trails log events for the master account and all member accounts. Can only be created in the organization master account."
type = bool
default = false
}
variable "cloudtrail_cloudwatch_logs_enabled" {
description = "Specifies whether the trail is delivered to CloudWatch Logs."
type = bool
default = true
}
variable "cloudtrail_cloudwatch_logs_group_name" {
description = "The name of CloudWatch Logs group to which CloudTrail events are delivered."
type = string
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."
type = number
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."
type = string
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."
type = string
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."
type = number
default = 10
}
variable "cloudtrail_name" {
description = "The name of the trail."
type = string
default = "cloudtrail-multi-region"
}
variable "cloudtrail_sns_topic_enabled" {
description = "Specifies whether the trail is delivered to a SNS topic."
type = bool
default = true
}
variable "cloudtrail_sns_topic_name" {
description = "The name of the SNS topic to link to the trail."
type = string
default = "cloudtrail-multi-region-sns-topic"
}
variable "cloudtrail_s3_key_prefix" {
description = "The prefix used when CloudTrail delivers events to the S3 bucket."
type = string
default = "cloudtrail"
}
variable "cloudtrail_s3_object_level_logging_buckets" {
description = "The list of S3 bucket ARNs on which to enable object-level logging."
type = list(string)
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."
type = list(string)
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."
type = list(string)
default = ["arn:aws:lambda"] # All lambdas
}
# --------------------------------------------------------------------------------------------------
# Variables for alarm-baseline module.
# --------------------------------------------------------------------------------------------------
variable "alarm_baseline_enabled" {
description = "Boolean whether alarm-baseline is enabled."
type = bool
default = true
}
variable "alarm_namespace" {
description = "The namespace in which all alarms are set up."
type = string
default = "CISBenchmark"
}
variable "alarm_sns_topic_name" {
description = "The name of the SNS Topic which will be notified when any alarm is performed."
type = string
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"
type = string
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."
type = bool
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."
type = bool
default = true
}
variable "mfa_console_signin_allow_sso" {
description = "The boolean flag whether the no_mfa_console_signin alarm allows SSO auth to be ignored."
type = bool
default = false
}
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."
type = bool
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."
type = bool
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."
type = bool
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."
type = bool
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."
type = bool
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."
type = bool
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."
type = bool
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."
type = bool
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."
type = bool
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."
type = bool
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."
type = bool
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."
type = bool
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."
type = bool
default = true
}
# --------------------------------------------------------------------------------------------------
# Variables for guardduty-baseline module.
# --------------------------------------------------------------------------------------------------
variable "guardduty_enabled" {
description = "Boolean whether the guardduty-baseline module is enabled or disabled"
type = bool
default = true
}
variable "guardduty_disable_email_notification" {
description = "Boolean whether an email notification is sent to the accounts."
type = bool
default = false
}
variable "guardduty_finding_publishing_frequency" {
description = "Specifies the frequency of notifications sent for subsequent finding occurrences."
type = string
default = "SIX_HOURS"
}
variable "guardduty_invitation_message" {
description = "Message for invitation."
type = string
default = "This is an automatic invitation message from guardduty-baseline module."
}
# --------------------------------------------------------------------------------------------------
# Variables for s3-baseline module.
# --------------------------------------------------------------------------------------------------
variable "s3_baseline_enabled" {
description = "Boolean whether s3-baseline is enabled."
type = bool
default = true
}
variable "s3_block_public_acls" {
description = "Whether Amazon S3 should block public ACLs for buckets in this account. Defaults to true."
type = bool
default = true
}
variable "s3_block_public_policy" {
description = "Whether Amazon S3 should block public bucket policies for buckets in this account. Defaults to true."
type = bool
default = true
}
variable "s3_ignore_public_acls" {
description = "Whether Amazon S3 should ignore public ACLs for buckets in this account. Defaults to true."
type = bool
default = true
}
variable "s3_restrict_public_buckets" {
description = "Whether Amazon S3 should restrict public bucket policies for buckets in this account. Defaults to true."
type = bool
default = true
}
# --------------------------------------------------------------------------------------------------
# Variables for securityhub-baseline module.
# --------------------------------------------------------------------------------------------------
variable "securityhub_enabled" {
description = "Boolean whether the securityhub-baseline module is enabled or disabled"
type = bool
default = true
}
variable "securityhub_enable_cis_standard" {
description = "Boolean whether CIS standard is enabled."
type = bool
default = true
}
variable "securityhub_enable_pci_dss_standard" {
description = "Boolean whether PCI DSS standard is enabled."
type = bool
default = false
}
variable "securityhub_enable_aws_foundational_standard" {
description = "Boolean whether AWS Foundations standard is enabled."
type = bool
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_baseline_enabled" {
description = "Boolean whether analyzer-baseline is enabled."
type = bool
default = true
}
variable "analyzer_name" {
description = "The name for the IAM Access Analyzer resource to be created."
type = string
default = "default-analyzer"
}