-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix: Ensure that user cannot override reserved labels #7222
Conversation
Signed-off-by: Simon Behar <simbeh7@gmail.com>
Signed-off-by: Simon Behar <simbeh7@gmail.com>
if _, reserved := common.ReservedWorkflowLabelKeys[labelSpec[0]]; reserved { | ||
log.Warnf("Ignoring label with key '%s' as it is reserved", labelSpec[0]) | ||
continue | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not super happy with this solution as it only checks CLI submitted labels. However, checking at the WF validation stage is problematic because legitimate reserved labels might be set by Argo sometime before the validation stage, requiring some refactor to correctly validate at that stage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes a CLI-only check would indeed be insufficient in many ways. A validation stage check or an informer change check would be most appropriate, but could also be worked around by a user with sufficient privileges.
Therefore, I don't think this approach is doable or that the issue itself is even solveable in k8s. SAs and other identity mechanisms within k8s should be used for this, as those are properly supported authN in k8s.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@simster7 Still working on this? |
@simster7 Any chance this is going to re-open? |
bump |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was linked in #13079, but I think this approach is problematic and the issue itself is unsolvable. Within k8s, any user with appropriate privileges can edit labels.
Argo can do a bunch of workarounds (as mentioned below) to try to prevent this, but those are workarounds at best and not solutions, and should not be relied on for authN purposes. In fact, I would say that any attempt at making this non-overriddeable would give a user a false sense of security and we should not give that intentionally. Trying to make this secure would create various vulnerabilities as well, due to breaking k8s's RBAC model.
As such, I'm going to mark this and the issue as won't fix.
k8s's own RBAC should be used for authN and authZ, which is what Argo's SSO RBAC feature uses. For more fine-grained RBAC, see #6490
if _, reserved := common.ReservedWorkflowLabelKeys[labelSpec[0]]; reserved { | ||
log.Warnf("Ignoring label with key '%s' as it is reserved", labelSpec[0]) | ||
continue | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes a CLI-only check would indeed be insufficient in many ways. A validation stage check or an informer change check would be most appropriate, but could also be worked around by a user with sufficient privileges.
Therefore, I don't think this approach is doable or that the issue itself is even solveable in k8s. SAs and other identity mechanisms within k8s should be used for this, as those are properly supported authN in k8s.
Fixes #7215, which could be a potential security vulnerability with users overriding labels set by Argo.
Signed-off-by: Simon Behar simbeh7@gmail.com
Don't bother creating a PR until you've done this:
make pre-commit -B
to fix codegen, lint, and commit message problems.Create your PR as a draft.
does not need to pass.
Tips: