Skip to content

Commit 9ebae7d

Browse files
authored
Merge pull request #315 from sil-org/https
Release 14.1.0 -- in-transit encryption
2 parents e9c30bc + 27b67f8 commit 9ebae7d

File tree

12 files changed

+45
-18
lines changed

12 files changed

+45
-18
lines changed

modules/040-id-broker/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Note 2: `internal_alb_listener_arn` can be omitted if `alb_listener_arn` is prov
4949
- `cpu_cron` - How much CPU (AWS CPU units, 1000 = 1 cpu) to allocate to cron service. Default: `128`
5050
- `cpu_email` - Amount of CPU (AWS CPU units, 1000 = 1 cpu) to allocate to email container. Default: `64`
5151
- `create_dns_record` - Controls creation of a DNS CNAME record for the ECS service. Default: `true`
52+
- `enable_tls` - Set to "true" to use HTTPS within the VPC. Default: `false`
5253
- `email_brand_color` - The CSS color to use for branding in emails (e.g. `rgb(0, 93, 154)`). Required for idp-id-broker version 8.0.0 or higher. Default: `"#005D99"` (blue)
5354
- `email_brand_logo` - The fully qualified URL to an image for use as logo in emails. Required for idp-id-broker version 8.0.0 or higher. Default: `""` (email header will show a "broken link" icon)
5455
- `email_repeat_delay_days` - Don't resend the same type of email to the same user for X days. Default: `31`

modules/040-id-broker/main.tf

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ locals {
99
*/
1010
resource "aws_alb_target_group" "broker" {
1111
name = substr("tg-${var.idp_name}-${var.app_name}-${var.app_env}", 0, 32)
12-
port = "80"
13-
protocol = "HTTP"
12+
port = var.enable_tls ? 443 : 80
13+
protocol = var.enable_tls ? "HTTPS" : "HTTP"
1414
vpc_id = var.vpc_id
1515
deregistration_delay = "30"
1616

@@ -19,8 +19,9 @@ resource "aws_alb_target_group" "broker" {
1919
}
2020

2121
health_check {
22-
path = "/site/status"
23-
matcher = "200,204"
22+
path = "/site/status"
23+
matcher = "200,204"
24+
protocol = var.enable_tls ? "HTTPS" : "HTTP"
2425
}
2526
}
2627

@@ -173,6 +174,7 @@ locals {
173174
password_mfa_lifespan_extension = var.password_mfa_lifespan_extension
174175
password_profile_url = var.password_profile_url
175176
password_reuse_limit = var.password_reuse_limit
177+
port = var.enable_tls ? "443" : "80"
176178
profile_review_interval = var.profile_review_interval
177179
run_task = ""
178180
send_get_backup_codes_emails = var.send_get_backup_codes_emails
@@ -226,7 +228,7 @@ module "ecsservice" {
226228
desired_count = var.desired_count
227229
tg_arn = aws_alb_target_group.broker.arn
228230
lb_container_name = "web"
229-
lb_container_port = "80"
231+
lb_container_port = var.enable_tls ? "443" : "80"
230232
task_role_arn = module.ecs_role.role_arn
231233
}
232234

modules/040-id-broker/task-definition.json.tftpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"portMappings": [
99
{
1010
"hostPort": 0,
11-
"containerPort": 80,
11+
"containerPort": ${port},
1212
"protocol": "tcp"
1313
}
1414
],

modules/040-id-broker/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,12 @@ variable "alb_listener_arn" {
233233
default = ""
234234
}
235235

236+
variable "enable_tls" {
237+
description = "Set to \"true\" to use HTTPS within the VPC"
238+
type = bool
239+
default = false
240+
}
241+
236242
variable "internal_alb_dns_name" {
237243
description = <<-EOT
238244
The DNS name for the IdP-in-a-Box's internal Application Load Balancer. This can be omitted if `alb_dns_name` is

modules/050-pw-manager/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ The password manager UI can be deployed using the [silinternatonal/pages/cloudfl
5454
- `alerts_email_enabled` - Enable or disabled alert notification emails. Default: `true`
5555
- `code_length` - Number of digits in reset code. Default: `"6"`
5656
- `create_dns_record` - Controls creation of a DNS CNAME record for the ECS service. Default: `true`
57+
- `enable_tls` - Set to "true" to use HTTPS within the VPC. Default: `false`
5758
- `extra_hosts` - Extra hosts for the API task definition, e.g. "\["hostname":"host.example.com","ipAddress":"192.168.1.1"\]"
5859
- `password_rule_enablehibp` - Enable haveibeenpwned.com password check. Default: `true`
5960
- `password_rule_maxlength` - Maximum password length. Default: `"255"`

modules/050-pw-manager/main.tf

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ locals {
1010
*/
1111
resource "aws_alb_target_group" "pwmanager" {
1212
name = substr("tg-${var.idp_name}-${var.app_name}-${var.app_env}", 0, 32)
13-
port = "80"
14-
protocol = "HTTP"
13+
port = var.enable_tls ? 443 : 80
14+
protocol = var.enable_tls ? "HTTPS" : "HTTP"
1515
vpc_id = var.vpc_id
1616
deregistration_delay = "30"
1717

@@ -20,8 +20,9 @@ resource "aws_alb_target_group" "pwmanager" {
2020
}
2121

2222
health_check {
23-
path = "/site/system-status"
24-
matcher = "200"
23+
path = "/site/system-status"
24+
matcher = "200"
25+
protocol = var.enable_tls ? "HTTPS" : "HTTP"
2526
}
2627
}
2728

@@ -105,6 +106,7 @@ locals {
105106
password_rule_maxlength = var.password_rule_maxlength
106107
password_rule_minlength = var.password_rule_minlength
107108
password_rule_minscore = var.password_rule_minscore
109+
port = var.enable_tls ? "443" : "80"
108110
recaptcha_secret_key = var.recaptcha_secret
109111
recaptcha_site_key = var.recaptcha_key
110112
sentry_dsn = var.sentry_dsn
@@ -127,7 +129,7 @@ module "ecsservice" {
127129
desired_count = var.desired_count
128130
tg_arn = aws_alb_target_group.pwmanager.arn
129131
lb_container_name = "web"
130-
lb_container_port = "80"
132+
lb_container_port = var.enable_tls ? "443" : "80"
131133
ecsServiceRole_arn = var.ecsServiceRole_arn
132134
task_role_arn = module.ecs_role.role_arn
133135
}

modules/050-pw-manager/task-definition-api.json.tftpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"portMappings": [
1010
{
1111
"hostPort": 0,
12-
"containerPort": 80,
12+
"containerPort": ${port},
1313
"protocol": "tcp"
1414
}
1515
],

modules/050-pw-manager/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ variable "desired_count" {
118118
default = 1
119119
}
120120

121+
variable "enable_tls" {
122+
description = "Set to \"true\" to use HTTPS within the VPC"
123+
type = bool
124+
default = false
125+
}
126+
121127
variable "docker_image" {
122128
description = "URL to Docker image"
123129
type = string

modules/060-simplesamlphp/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ This module is used to create an ECS service running [SimpleSAMLphp](https://sim
4545
## Optional Inputs
4646

4747
- `create_dns_record` - Controls creation of a DNS CNAME record for the ECS service. Default: `true`
48+
- `enable_tls` - Set to "true" to use HTTPS within the VPC. Default: `false`
4849
- `enable_debug` - Enable debug logs. Default: `false`
4950
- `logging_level` - Minimum log level to log. DO NOT use DEBUG in production. Allowed values: ERR, WARNING, NOTICE, INFO, DEBUG. Default: `NOTICE`
5051
- `mfa_learn_more_url` - URL to learn more about 2SV during profile review. Default: (link not displayed)

modules/060-simplesamlphp/main.tf

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ locals {
99
*/
1010
resource "aws_alb_target_group" "ssp" {
1111
name = substr("tg-${var.idp_name}-${var.app_name}-${var.app_env}", 0, 32)
12-
port = "80"
13-
protocol = "HTTP"
12+
port = var.enable_tls ? 443 : 80
13+
protocol = var.enable_tls ? "HTTPS" : "HTTP"
1414
vpc_id = var.vpc_id
1515
deregistration_delay = "30"
1616

1717
health_check {
18-
path = "/module.php/silauth/status.php"
19-
matcher = "200"
18+
path = "/module.php/silauth/status.php"
19+
matcher = "200"
20+
protocol = var.enable_tls ? "HTTPS" : "HTTP"
2021
}
2122
}
2223

@@ -97,6 +98,7 @@ locals {
9798
mysql_password = var.mysql_pass
9899
mysql_user = var.mysql_user
99100
parameter_store_path = local.parameter_store_path
101+
port = var.enable_tls ? "443" : "80"
100102
profile_url = var.profile_url
101103
recaptcha_key = var.recaptcha_key
102104
recaptcha_secret = var.recaptcha_secret
@@ -120,7 +122,7 @@ module "ecsservice" {
120122
desired_count = var.desired_count
121123
tg_arn = aws_alb_target_group.ssp.arn
122124
lb_container_name = "web"
123-
lb_container_port = "80"
125+
lb_container_port = var.enable_tls ? "443" : "80"
124126
ecsServiceRole_arn = var.ecsServiceRole_arn
125127
task_role_arn = module.ecs_role.role_arn
126128
}

0 commit comments

Comments
 (0)