From 382bde0d91a21cbef77a2e332a6abaaa2e9e6ebd Mon Sep 17 00:00:00 2001 From: Steven Palmesano <3100993+spalmesano0@users.noreply.github.com> Date: Fri, 16 Jan 2026 14:20:13 -0600 Subject: [PATCH] Add example for disabling the /version page for security hardening (#159) Per @BCTBB's testing done here: https://fleetdm.slack.com/archives/C051QJU3D0V/p1767198630645379?thread_ts=1767193373.532409&cid=C051QJU3D0V --------- Co-authored-by: Jorge Falcon <22119513+BCTBB@users.noreply.github.com> --- byo-vpc/example/main.tf | 18 +++++++++++++++++- example/main.tf | 17 +++++++++++++++-- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/byo-vpc/example/main.tf b/byo-vpc/example/main.tf index 2fef529..4d4400a 100644 --- a/byo-vpc/example/main.tf +++ b/byo-vpc/example/main.tf @@ -130,7 +130,23 @@ module "byo-vpc" { values = ["yes", "true"] }] }] - }] + }, + # This prevents exposing the Fleet and Go versions publicly + # { + # priority = 9000 + # actions = [{ + # type = "fixed-response" + # content_type = "text/html" + # status_code = "404" + # message_body = "

404 Not Found

" + # }] + # conditions = [{ + # path_patterns = [ + # "/version" + # ] + # }] + # }, + ] } ecs_cluster = { cluster_name = random_pet.main.id diff --git a/example/main.tf b/example/main.tf index fef878d..e5f8260 100644 --- a/example/main.tf +++ b/example/main.tf @@ -196,6 +196,19 @@ module "fleet" { # path_patterns = ["*"] # }] # }, { + # priority = 8999 + # actions = [{ + # type = "fixed-response" + # content_type = "text/html" + # status_code = "404" + # message_body = "

404 Not Found

" + # }] + # conditions = [{ + # path_patterns = [ + # "/version" + # ] + # }] + # }, { # priority = 1 # actions = [{ # type = "forward" @@ -266,9 +279,9 @@ module "migrations" { desired_count = module.fleet.byo-vpc.byo-db.byo-ecs.appautoscaling_target.min_capacity min_capacity = module.fleet.byo-vpc.byo-db.byo-ecs.appautoscaling_target.min_capacity max_capacity = module.fleet.byo-vpc.byo-db.byo-ecs.appautoscaling_target.max_capacity - + depends_on = [ - module.fleet, + module.fleet, ] }