From 65ce1b55f013e0d3adbe8bdb6d432aa0eef964cd Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Tue, 28 Jun 2022 12:11:07 -0700 Subject: [PATCH] Fix secrets access from nomad tasks Probably can be cleaned up and updated to follow least access --- nomad/acls/nomad_vault.tf | 20 +++++++++++- nomad/nextcloud/nextcloud.nomad | 56 +++++++++++++++++++++++++++------ 2 files changed, 66 insertions(+), 10 deletions(-) diff --git a/nomad/acls/nomad_vault.tf b/nomad/acls/nomad_vault.tf index 3c38c63..3f4a13a 100644 --- a/nomad/acls/nomad_vault.tf +++ b/nomad/acls/nomad_vault.tf @@ -35,12 +35,24 @@ EOH resource "vault_token_auth_backend_role" "nomad-cluster" { role_name = "nomad-cluster" token_explicit_max_ttl = 0 - allowed_policies = ["access-tables"] + allowed_policies = ["access-tables", "nomad-task"] orphan = true token_period = 259200 renewable = true } +# Policy for clusters +resource "vault_policy" "nomad-task" { + name = "nomad-task" + policy = <