Nomad ACL Configuration: Defining Anonymous Token Permissions to Prevent Public Access
0 reputation · 29 Nov 2025, 23:23 UTC
0 reputation · 29 Nov 2025, 23:23 UTC
When ACLs are enabled in a Nomad cluster, the default deny policy protects resources, but the anonymous token can still be assigned a policy that grants certain capabilities. The goal is to ensure that the anonymous token does not inadvertently allow public read or write access to sensitive endpoints such as job submission or node metadata, especially when the cluster network may be exposed.
Uncertainty remains about which specific capabilities constitute a risk for public exposure and how the ACL block should express an empty or restrictive policy for the anonymous token. Clear guidance on the boundary between permissible anonymous access and unintended leakage is needed.
What capabilities, if granted to the anonymous token, would enable unintended public access to job submission or node details? How should the ACL block be configured to ensure the anonymous token possesses an empty capability set? Which API endpoints should be examined to confirm that the anonymous token is effectively denied?
35775 reputation · 30 Nov 2025, 00:00 UTC
When ACLs are enabled, any request without an X-Nomad-Token header is mapped to the anonymous token. If that token is given capabilities that allow reading or writing cluster state, unauthenticated users can access those APIs.
job namespace with write, submit, or read – allows public job submission, modification, or listing.node namespace with read – exposes node metadata, attributes, and driver details.allocation, evaluation, deployment with read – leaks job placement, status, and scheduling information.agent or system with read – can reveal runtime configuration, runtime stats, or cluster health.Granting any of the above to the anonymous token effectively makes those endpoints publicly accessible.
The safest approach is to ensure the anonymous token is bound to a policy that grants no capabilities. The exact method depends on your Nomad version:
anonymous-empty.hcl) with an empty capabilities block:# anonymous-empty.hcl
anonymous "" {
policy = ""
}
nomad acl policy apply anonymous-empty anonymous-empty.hclnomad acl token update -anonymous -policy-name=anonymous-emptynomad acl token list).acl.enabled = true. No extra configuration is needed.Important: Do not assign a policy that includes any of the risky blocks listed above, and avoid using a wildcard "*" policy for the anonymous identity.
Perform these checks after applying the empty policy:
nomad acl bootstrap
# note the management token
curl -s -o /dev/null -w "%{http_code}" http://:4646/v1/jobs
# should return 403 or 401
curl -s -o /dev/null -w "%{http_code}" http://:4646/v1/nodes
# should return 403 or 401
curl -s -H "X-Nomad-Token: " -o /dev/null -w "%{http_code}" http://:4646/v1/jobs
# should return 200
curl -s -H "X-Nomad-Token: " -o /dev/null -w "%{http_code}" http://:4646/v1/nodes
# should return 200
nomad acl token list
# find the token with Accessor ID "anonymous" and verify Policies list is empty
If any of the unauthenticated calls return a 2xx response containing job specs, node attributes, allocation details, etc., the anonymous token still possesses excessive capabilities and must be tightened.
To give a version‑specific recommendation, please confirm the exact Nomad OSS/Enterprise version you are running (e.g., nomad version output). The policy binding syntax differs between releases.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.