Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

acl: disallow leading / on variable paths #23757

Merged
merged 2 commits into from
Aug 7, 2024
Merged

Conversation

tgross
Copy link
Member

@tgross tgross commented Aug 6, 2024

The path for a Variable never begins with a leading /, because it's stripped off in the API before it ever gets to the state store. The CLI and UI allow the leading / for convenience, but this can be misleading when it comes to writing ACL policies. An ACL policy with a path starting with a leading / will never match.

Update the ACL policy parser so that we prevent an incorrect variable path in the policy.

Fixes: #23730

The path for a Variable never begins with a leading `/`, because it's stripped
off in the API before it ever gets to the state store. The CLI and UI allow the
leading `/` for convenience, but this can be misleading when it comes to writing
ACL policies. An ACL policy with a path starting with a leading `/` will never
match.

Update the ACL policy parser so that we prevent an incorrect variable path in
the policy.

Fixes: #23730
acl/policy.go Outdated Show resolved Hide resolved
acl/policy_test.go Outdated Show resolved Hide resolved
Co-authored-by: Michael Schurter <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nomad ACL Policy for variables can't accessed when defined with leading slash
2 participants