-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path_variable.tf
More file actions
565 lines (503 loc) · 14.5 KB
/
_variable.tf
File metadata and controls
565 lines (503 loc) · 14.5 KB
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
variable "internal" {
type = bool
description = "Flag to determine if the several AWS resources are public (intended for external access, public internet) or private (only intended to be accessed within your AWS VPC or avaiable with other means, a transit gateway for example)."
default = true
}
variable "alb_idle_timeout" {
type = number
description = "The idle timeout value in seconds for the Application Load Balancer (ALB)"
default = 900
}
variable "alb_listener_ssl_policy" {
type = string
description = "SSL policy to use for the listener. This policy determines how SSL/TLS connections are handled."
default = "ELBSecurityPolicy-TLS13-1-2-2021-06"
}
variable "appmesh_name" {
type = string
description = "Name of the AWS App Mesh"
default = ""
}
variable "cloudmap_namespace_name" {
type = string
description = "Name of the AWS Cloud Map namespace"
default = ""
}
variable "cw_retention_in_days" {
type = number
description = "Retention period in days for CloudWatch logs"
default = 365
}
variable "ecs_alb_name" {
description = "Name of the Application Load Balancer (ALB)"
type = string
default = ""
}
variable "ecs_alb_tg_name" {
description = "Name of the ALB Target Group"
type = string
default = ""
}
variable "ecs_cluster_name" {
type = string
description = "Name of the ECS Cluster"
default = ""
}
variable "ecs_cloudwatch_group" {
type = string
description = "Name of the AWS CloudWatch Log Group for ECS"
default = ""
}
variable "ecs_task_execution_role_name" {
type = string
description = "Name of the ECS Task Execution Role"
default = ""
}
variable "ecs_task_role_name" {
type = string
description = "Name of the ECS Task Role"
default = ""
}
variable "enable_autoscaling" {
type = bool
description = "Flag to enable autoscaling for the ECS services"
default = true
}
variable "enable_alb_logs" {
type = bool
description = "Flag to enable ALB access and connection logging to s3 logging bucket"
default = true
}
variable "enable_alb_deletion_protection" {
type = bool
description = "Flag to enable ALB deletion protection"
default = true
}
variable "private_subnet_ids" {
type = list(string)
description = "List of private subnet IDs"
}
variable "public_subnet_ids" {
type = list(string)
description = "List of public subnet IDs"
}
variable "region" {
type = string
description = "The AWS region where resources are created"
}
variable "s3_viewer_bucket_name" {
type = string
description = "Name of the S3 bucket for the viewer"
default = ""
}
variable "s3_viewer_bucket_role_name" {
type = string
description = "Name of the IAM role for the ecr-viewer bucket"
default = ""
}
variable "s3_logging_bucket_name" {
type = string
description = "Name of the S3 bucket for logging"
default = ""
}
variable "phdi_version" {
type = string
description = "Version of the PHDI application"
default = "v2.0.0-beta"
}
variable "service_data" {
type = map(object({
short_name = string
app_repo = string
app_image = string
app_version = string
container_port = number
host_port = number
public = bool
registry_url = string
root_service = bool
listener_priority = number
env_vars = list(object({
name = string
value = string
}))
}))
description = "Data for the DIBBS services"
default = {}
}
variable "ecr_viewer_bucket_lifecycle_configuration" {
type = list(object({
status = string
prefix = string
abort_incomplete_upload_after_days = number
expiration_days = number
transitions = list(object({
days = number
storage_class = string
}))
}))
description = "S3 lifecycle rules"
default = [{
status = "Enabled"
prefix = "/"
abort_incomplete_upload_after_days = 3
expiration_days = 365
transitions = [
{
days = 0
storage_class = "INTELLIGENT_TIERING"
}
]
}]
}
variable "logging_bucket_lifecycle_configuration" {
type = list(object({
status = string
prefix = string
abort_incomplete_upload_after_days = number
expiration_days = number
transitions = list(object({
days = number
storage_class = string
}))
}))
description = "S3 lifecycle rules"
default = [{
status = "Enabled"
prefix = "/"
abort_incomplete_upload_after_days = 3
expiration_days = 365
transitions = [
{
days = 0
storage_class = "INTELLIGENT_TIERING"
}
]
}]
}
variable "override_autoscaling" {
type = map(object({
cpu = number
memory = number
min_capacity = number
max_capacity = number
target_cpu = number
target_memory = number
}))
description = "Autoscaling configuration for the DIBBS services"
default = {}
}
variable "secrets_manager_connection_string_version" {
type = string
default = ""
sensitive = true
}
variable "secrets_manager_sqlserver_user_version" {
type = string
default = ""
sensitive = true
}
variable "secrets_manager_sqlserver_password_version" {
type = string
default = ""
sensitive = true
}
variable "secrets_manager_sqlserver_host_version" {
type = string
default = ""
sensitive = true
}
variable "secrets_manager_metadata_database_migration_secret_version" {
type = string
default = ""
sensitive = true
}
variable "auth_provider" {
type = string
default = ""
description = "The authentication provider used. Either keycloak or ad."
}
variable "auth_client_id" {
type = string
default = ""
description = "The application/client id used to idenitfy the client"
}
variable "auth_issuer" {
type = string
default = ""
description = "Additional information used during authentication process. For Azure AD, this will be the 'Tenant Id'. For Keycloak, this will be the url issuer including the realm - e.g. https://my-keycloak-domain.com/realms/My_Realm"
}
variable "auth_url" {
type = string
default = ""
description = "Optional. The full URL of the auth api. By default https://your-site.com/ecr-viewer/api/auth."
}
variable "auth_session_duration_min" {
type = string
default = ""
description = "Duration in minutes before auto signout, defaults to 30 if not set"
}
variable "secrets_manager_auth_secret_version" {
type = string
default = ""
description = "The secret containing the auth secret. This is used by eCR viewer to encrypt authentication. This can be generated by running `openssl rand -base64 32`."
sensitive = true
}
variable "secrets_manager_auth_client_secret_version" {
type = string
default = ""
description = "The secret containing the auth client secret. This is the secret that comes from the authentication provider."
sensitive = true
}
variable "certificate_arn" {
type = string
description = "ARN of the SSL certificate that enables ssl termination on the ALB"
default = ""
}
variable "vpc_id" {
type = string
description = "ID of the VPC"
}
variable "owner" {
type = string
description = "Owner of the resources"
default = "CDC"
}
variable "project" {
type = string
description = "The project name"
default = "dibbs"
}
variable "disable_ecr" {
type = bool
description = "Flag to disable the aws ecr service for docker image storage, defaults to false"
default = false
}
variable "enable_enhanced_ecr_registry_scanning" {
type = bool
description = "Flag to enable enhanced ecr registry scanning, defaults to false"
default = false
}
variable "tags" {
type = map(string)
description = "Tags to apply to resources"
default = {}
}
variable "ecr_viewer_auth_pub_key" {
type = string
description = "The public key used to validate the incoming authenication for the eCR Viewer."
default = ""
}
variable "ecr_viewer_auth_api_pub_key" {
type = string
description = "The public key used to validate the incoming authenication for the eCR Viewer API."
default = ""
}
variable "dibbs_config_name" {
type = string
description = "Name of the DIBBS configuration"
default = ""
}
variable "dibbs_repo" {
type = string
description = "Name of the DIBBS repository"
default = "ghcr.io/cdcgov/dibbs-ecr-viewer"
}
variable "db_cipher" {
type = string
description = "The cipher to use for the sql server database connection"
default = ""
}
variable "ecr_viewer_object_retention_days" {
type = number
description = "Number of days to retain S3 ecr viewer objects in compliance mode"
default = 365
}
variable "logging_object_retention_days" {
type = number
description = "Number of days to retain S3 logging objects in compliance mode"
default = 365
}
variable "ecr_viewer_object_mode" {
type = string
description = "Mode to set the S3 ecr viewer objects to"
default = "GOVERNANCE"
}
variable "logging_object_mode" {
type = string
description = "Mode to set the S3 logging objects to"
default = "GOVERNANCE"
}
variable "ecr_processing_timeout" {
type = string
description = "Set processing timeout length in ms,if not set defaults to 900000ms (15min)"
default = "900000"
}
variable "waf_web_acl_arn" {
type = string
description = "Existing WAF Web ACL ID to associate with ALB. If empty, a new ACL will be created."
default = ""
}
variable "waf_enable_cloudwatch_metrics" {
type = bool
description = "Flag to enable CloudWatch metrics for WAF. Set to false to disable compliance."
default = true
}
variable "waf_enable_sampled_requests" {
type = bool
description = "Flag to enable sampled requests for WAF. Set to false to disable compliance."
default = true
}
variable "waf_rules" {
type = list(any)
default = [
{
name = "AWSManagedRulesCommonRuleSet"
vendor_name = "AWS"
priority = 1
allow = []
block = [
"NoUserAgent_HEADER",
"UserAgent_BadBots_HEADER",
"SizeRestrictions_QUERYSTRING",
"SizeRestrictions_Cookie_HEADER",
"SizeRestrictions_URIPATH",
"EC2MetaDataSSRF_BODY",
"EC2MetaDataSSRF_COOKIE",
"EC2MetaDataSSRF_URIPATH",
"EC2MetaDataSSRF_QUERYARGUMENTS",
"GenericLFI_QUERYARGUMENTS",
"GenericLFI_URIPATH",
"RestrictedExtensions_URIPATH",
"RestrictedExtensions_QUERYARGUMENTS",
"GenericRFI_QUERYARGUMENTS",
"GenericRFI_BODY",
"GenericRFI_URIPATH",
"CrossSiteScripting_BODY",
"CrossSiteScripting_COOKIE",
"CrossSiteScripting_QUERYARGUMENTS",
"CrossSiteScripting_URIPATH",
]
captcha = []
challenge = []
count = [
"SizeRestrictions_BODY",
"GenericLFI_BODY",
]
}, {
name = "AWSManagedRulesLinuxRuleSet"
vendor_name = "AWS"
priority = 2
allow = []
block = [
"LFI_URIPATH",
"LFI_QUERYSTRING",
"LFI_HEADER"
]
captcha = []
challenge = []
count = []
}, {
name = "AWSManagedRulesUnixRuleSet"
vendor_name = "AWS"
priority = 3
allow = []
block = [
"UNIXShellCommandsVariables_QUERYARGUMENTS",
"UNIXShellCommandsVariables_BODY",
]
captcha = []
challenge = []
count = []
}, {
name = "AWSManagedRulesSQLiRuleSet"
vendor_name = "AWS"
priority = 4
allow = []
block = [
"SQLi_QUERYARGUMENTS",
"SQLiExtendedPatterns_QUERYARGUMENTS",
"SQLi_BODY",
"SQLiExtendedPatterns_BODY",
"SQLi_COOKIE",
]
captcha = []
challenge = []
count = []
}, {
name = "AWSManagedRulesKnownBadInputsRuleSet"
vendor_name = "AWS"
priority = 5
allow = []
block = [
"JavaDeserializationRCE_HEADER",
"JavaDeserializationRCE_BODY",
"JavaDeserializationRCE_URIPATH",
"JavaDeserializationRCE_QUERYSTRING",
"Host_localhost_HEADER",
"PROPFIND_METHOD",
"ExploitablePaths_URIPATH",
"Log4JRCE_HEADER",
"Log4JRCE_QUERYSTRING",
"Log4JRCE_BODY",
"Log4JRCE_URIPATH",
]
captcha = []
challenge = []
count = []
}, {
name = "AWSManagedRulesBotControlRuleSet"
vendor_name = "AWS"
priority = 6
allow = []
block = [
"SignalAutomatedBrowser",
"CategoryAdvertising",
"CategoryArchiver",
"CategoryContentFetcher",
"CategoryEmailClient",
"CategoryLinkChecker",
"CategoryMiscellaneous",
"CategoryMonitoring",
"CategoryScrapingFramework",
"CategorySearchEngine",
"CategorySecurity",
"CategorySeo",
"CategorySocialMedia",
"CategoryAI",
"SignalKnownBotDataCenter"
]
captcha = []
challenge = []
count = [
"SignalNonBrowserUserAgent",
"CategoryHttpLibrary",
]
}
]
}
variable "block_ip_set" {
default = []
type = list(string)
description = "List of IP to block"
}
variable "enable_ecr_viewer_sns_topic" {
type = bool
description = "Enable ECR Viewer bucket SNS topic"
default = true
}
variable "ecr_viewer_bucket_sns_topic_events" {
type = list(any)
default = ["s3:ObjectCreated:CompleteMultipartUpload"]
description = "List of events that trigger the SNS ecr viewer topic"
}
variable "enable_logging_sns_topic" {
type = bool
description = "Enable logging bucket SNS topic"
default = true
}
variable "logging_bucket_sns_topic_events" {
type = list(any)
default = ["s3:ObjectCreated:CompleteMultipartUpload"]
description = "List of events that trigger the SNS logging topic"
}