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

Backport of service: fix regression in task access to list/read endpoint into release/1.5.x #16317

Conversation

hc-github-team-nomad-core
Copy link
Contributor

Backport

This PR is auto-generated from #16316 to be assessed for backporting due to the inclusion of the label backport/1.5.x.

The below text is copied from the body of the original PR.


Fixes #16276

When native service discovery was added, we used the node secret as the auth token. Once Workload Identity was added in Nomad 1.4.x we needed to use the claim token for template blocks, and so we allowed valid claims to bypass the ACL policy check to preserve the existing behavior. (Invalid claims are still rejected, so this didn't widen any security boundary.)

In reworking authentication for 1.5.0, we unintentionally removed this bypass. For WIs without a policy attached to their job, everything works as expected because the resulting acl.ACL is nil. But once a policy is attached to the job the acl.ACL is no longer nil and this causes permissions errors.

Fix the regression by adding back the bypass for valid claims. In future work, we should strongly consider getting turning the implicit policies into real ACLPolicy objects (even if not stored in state) so that we don't have these kind of brittle exceptions to the auth code.

@hc-github-team-nomad-core hc-github-team-nomad-core force-pushed the backport/issue16276-permissions/especially-bright-rattler branch from 8ee9160 to c0231ae Compare March 3, 2023 16:41
@hc-github-team-nomad-core hc-github-team-nomad-core merged commit f9f8d4e into release/1.5.x Mar 3, 2023
@hc-github-team-nomad-core hc-github-team-nomad-core force-pushed the backport/issue16276-permissions/especially-bright-rattler branch from 37613c6 to 2336e93 Compare March 3, 2023 16:41
@hc-github-team-nomad-core hc-github-team-nomad-core deleted the backport/issue16276-permissions/especially-bright-rattler branch March 3, 2023 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants