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

policies for workload identity aren't merged #14031

Closed
tgross opened this issue Aug 5, 2022 · 6 comments
Closed

policies for workload identity aren't merged #14031

tgross opened this issue Aug 5, 2022 · 6 comments

Comments

@tgross
Copy link
Member

tgross commented Aug 5, 2022

If you have a job example with task group web and task name httpd the allocation's workload identity will automatically be granted Read access to the secure variable path nomad/jobs/example/web/httpd (as well as nomad/jobs, nomad/jobs/example, and nomad/jobs/example/web. However, if you add an extra policy to get automatically associated to the job, only that policy is used. So for example, if I create the following policy at _:example/web/httpd (keeping in mind this name doesn't actually work, see #13995):

namespace "dev" {
    path   "*" {
      capabilities = ["list"]
    }
  }
}

Then I the task's WI can no longer Read nomad/jobs/example/web/httpd, only List it. Instead we need:

namespace "dev" {

  secure_variables {
    path   "nomad/jobs/example/web/httpd" {
      capabilities = ["list", "read"]
    }

    path   "*" {
      capabilities = ["list"]
    }
  }
}

This is counter to the way we normally expect policies to be additive.

@tgross tgross added this to the 1.4.0 milestone Aug 5, 2022
@tgross tgross self-assigned this Aug 5, 2022
@tgross
Copy link
Member Author

tgross commented Aug 5, 2022

@angrycub @mikenomitch this issue description makes me realize we probably need to come up with some standardized and documented name for the difference between:

  • The implicit policy that gives a Workload Identity claim to secure variables that match it.
  • The automatically-associated policy that doesn't exist until a user creates one with a matching name.

@mikenomitch
Copy link
Contributor

The implicit policy that gives a Workload Identity claim to secure variables that match it - I think maybe this concept needs a name, but the actual "policy" itself feels like a code-level detail. So it could maybe use a variable name, but am I right to think that it won't be user facing?

The automatically-associated policy that doesn't exist until a user creates one with a matching name - Maybe just "the (namespace's|job's|group's|task's) Implicit Policy"?

@tgross
Copy link
Member Author

tgross commented Aug 15, 2022

I think maybe this concept needs a name, but the actual "policy" itself feels like a code-level detail. So it could maybe use a variable name, but am I right to think that it won't be user facing?

Yeah, in retrospect I think we want a name for this mostly for our own internal discussions because it's easy to mix up the two.

@tgross
Copy link
Member Author

tgross commented Aug 16, 2022

I think I've got an approach in mind for this but want to land #14140 first. I'll fork from that branch with the fix.

@tgross
Copy link
Member Author

tgross commented Aug 16, 2022

After a bit more investigation I discovered this is an invalid bug. The problem in the original description is that I've got an invalid policy document of the same sort of user error that we'll catch now with #14123. I've added an extra test to #14140 that demonstrates this is actually working just fine. 🤦

@tgross tgross closed this as not planned Won't fix, can't repro, duplicate, stale Aug 16, 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 Dec 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants