[nomad-step-2] S2.3 — vault-nomad-auth.sh (enable JWT auth + roles + nomad workload identity) #881
Labels
No labels
action
backlog
blocked
bug-report
cannot-reproduce
in-progress
in-triage
needs-triage
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
rejected
reproduced
tech-debt
underspecified
vision
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#881
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of the Nomad+Vault migration. Step 2 — Vault policies + workload identity + secrets import.
Goal
Enable Vault's JWT auth method and configure Nomad workload identity so Nomad jobs can exchange their short-lived identity tokens for Vault tokens with the right policies attached — no shared
VAULT_TOKENin job env.Scope
Create
lib/init/nomad/vault-nomad-auth.sh:jwt-nomad:vault write auth/jwt-nomad/role/service-forgejo ...bound audience["vault.io"], bound_claims filtering onnomad_namespace/nomad_job_id, token_policies=["service-forgejo"], token_ttl=1h, token_max_ttl=24h.service-woodpecker,bot-*,dispatcher, and eachrunner-<SECRET>.nomad/server.hcl(from S0.2) to add avaultstanza: Restart nomad once after this change lands (idempotent viasystemctl kill -s SIGHUP).jwt-nomadauth is already enabled and config hash matches, no-op with[vault-auth] jwt-nomad already configured. Role diffs are per-role, same pattern.Create companion script
tools/vault-apply-roles.shthat reads the role list from a single declarative filevault/roles.yaml(or HCL equivalent) so the role-to-policy bindings aren't buried in shell. That file lists each Vault-role name + associated policy. This keeps S2.1 policies and S2.3 role bindings in sync at review time.Acceptance criteria
vault-nomad-auth.shenables JWT, writes roles, updates nomad config, reloads nomad.nomad node status -self -verbose | grep -i vaultshows vault integration reportingConnected.vault { role = "service-forgejo" }can render atemplatestanza readingkv/disinto/shared/forgejo/*successfully (use a fixture KV entry; no real secret).shellcheckclean.vault/policies/AGENTS.md(extend from S2.1): how role names map to policy names, how to add a new service.Non-goals
root.tokenyet — root stays available for ops until Step 6 cutover.Labels / meta
[nomad-step-2] S2.3— no dependencies.