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

parse-job access is missing from ACL write defaults #12254

Closed
idrennanvmware opened this issue Mar 10, 2022 · 6 comments
Closed

parse-job access is missing from ACL write defaults #12254

idrennanvmware opened this issue Mar 10, 2022 · 6 comments
Assignees
Labels
stage/waiting-on-upstream This issue is waiting on an upstream PR review theme/auth theme/docs Documentation issues and enhancements

Comments

@idrennanvmware
Copy link
Contributor

When upgrading to Nomad 1.2.6 we noticed a functional regression in our tests. This was caused due to a test that was using the "write" acl (documented here: https://learn.hashicorp.com/tutorials/nomad/access-control-policies?in=nomad/access-control#write) which is missing the 'parse-job' granular item and is only present in "read" currently.

Request is to add this to the "write" as well

Thanks!
Ian

Screen Shot 2022-03-10 at 1 29 47 AM

@tgross tgross added theme/docs Documentation issues and enhancements theme/auth stage/waiting-reply labels Mar 10, 2022
@tgross
Copy link
Member

tgross commented Mar 10, 2022

Hi @idrennanvmware! I took a look at the code and also tried to test the behavior and I think this is a documentation issue.

With a policy like:

namespace "*" {
  policy = "write"
}

I was able to validate a jobspec.

If you look at the ACLs code you can see that the new parse-job capability is found in the coarse-grained read ACL, as documented (ref policy.go#L170). But the read capabilities are copied into the write capabilities (on line 180).

All that being said, you mentioned that there was a failed regression test. Can you share the policy file and error you saw? Maybe there's something we missed.

That documentation page is in a closed repo. I'll open up a PR over there shortly to fix the docs as well.

@tgross tgross self-assigned this Mar 10, 2022
@lgfa29
Copy link
Contributor

lgfa29 commented Mar 10, 2022

@idrennanvmware another documentation piece that is missing is that the namespace in your request must match a namespace that is allowed by your policy.

I opened #12258 to describe this.

@idrennanvmware
Copy link
Contributor Author

@tgross and @lgfa29

Apologies for not getting back sooner - was OOO.

You are right - our test failures weren't related to the policy and the "fix" was just a timing issue that gave us the red herring. I believe you are both right and it's just missing from documentation and the 'write' section needs to be updated.

Functionally the root cause of our problem was actually latency from the time a token was issued from Nomad until it was valid for use. Interestingly we haven't encountered this in the past so the latency seems new (we were creating and immediately using a token) - we just ensure the token is valid now in our tests and move on. Not sure why it's more latent than before or if there are external factors contributing - but please feel free to close this issue when you're ready.

Thanks for the help and time - apologies for the misdirection.

@tgross
Copy link
Member

tgross commented Mar 15, 2022

I've got the PR for Learn open and once that gets merged for deployment, I'll close it this issue.

@tgross tgross added stage/waiting-on-upstream This issue is waiting on an upstream PR review and removed stage/waiting-reply type/bug labels Mar 15, 2022
@tgross
Copy link
Member

tgross commented Mar 15, 2022

Ok, fixed on https://learn.hashicorp.com/tutorials/nomad/access-control-policies?in=nomad/access-control#write. Thanks @idrennanvmware !

@tgross tgross closed this as completed Mar 15, 2022
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stage/waiting-on-upstream This issue is waiting on an upstream PR review theme/auth theme/docs Documentation issues and enhancements
Projects
Development

No branches or pull requests

3 participants