Skip to content

Commit 0eeddd5

Browse files
committed
security: disable service account token mount on workspace pods
Workspace pods have no reason to talk to the K8s API. Setting automount_service_account_token = false removes the token from the pod, eliminating attack surface if a container is compromised.
1 parent 8c88cdb commit 0eeddd5

File tree

1 file changed

+3
-0
lines changed
  • modules/kubernetes-workspace

1 file changed

+3
-0
lines changed

modules/kubernetes-workspace/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ resource "kubernetes_pod_v1" "workspace" {
106106
# Sysbox runtime for Docker-in-Docker support
107107
runtime_class_name = var.runtime_class_name
108108

109+
# Workspace pods have no reason to talk to the K8s API
110+
automount_service_account_token = false
111+
109112
# Image pull secrets for private registries
110113
dynamic "image_pull_secrets" {
111114
for_each = var.image_pull_secrets

0 commit comments

Comments
 (0)