Skip to content

Commit f3b46d8

Browse files
Adding security.txt file to the load balancer for Valentine (#28)
* Adding security.txt file to the load balancer * Updating RDS version
1 parent 5fd6f6e commit f3b46d8

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

terraform/aws/alb.tf

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,34 @@ resource "aws_lb" "valentine" {
5858
"CostCentre" = var.billing_code
5959
}
6060
}
61+
62+
# Serve security.txt as a fixed response from the ALB
63+
resource "aws_alb_listener_rule" "security_txt" {
64+
listener_arn = aws_lb_listener.valentine_listener.arn
65+
priority = 1
66+
67+
action {
68+
type = "fixed-response"
69+
70+
fixed_response {
71+
content_type = "text/plain"
72+
message_body = <<-EOT
73+
Contact: mailto:ZZTBSCYBERS@tbs-sct.gc.ca
74+
Contact: https://hackerone.com/tbs-sct/
75+
Canonical: https://${replace(var.domain, "/^[^.]+\\./", "")}/.well-known/security.txt
76+
Expires: 2026-03-02T12:00:00.000Z
77+
Preferred-Languages: en, fr
78+
EOT
79+
status_code = "200"
80+
}
81+
}
82+
83+
condition {
84+
path_pattern {
85+
values = ["/.well-known/security.txt"]
86+
}
87+
}
88+
tags = {
89+
"CostCentre" = var.billing_code
90+
}
91+
}

terraform/aws/rds.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module "rds_cluster" {
1010

1111
database_name = "valentine"
1212
engine = "aurora-postgresql"
13-
engine_version = "14.15"
13+
engine_version = "14.17"
1414
instance_class = "db.t3.medium"
1515
instances = 1
1616
username = "valentine"

0 commit comments

Comments
 (0)