triggers: Users should only be able to create TriggerTemplates for resources they are permissioned to use
In the current design, users would be able to use the spec.resourceTemplates field to escalate their degree of write permission within the cluster; users of TriggerTemplate are able to create any resource that the service account responsible for creating resources in a TriggerTemplate has permission to create. For example, if a user does not have access to create Pods, but the service account servicing TriggerTemplate does, a user could put a Pod into spec.resourceTemplates and have it created.
We should protect against this form of privilege escalation by having a validating webhook that uses information from the authorizer (this is part of the payload webhooks are passed) to make SAR checks that establish that the user creating or updating a TriggerTemplate has permission to create those resources in the cluster.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 33 (15 by maintainers)
UPDATE: we had a centralized discussion on this in today’s WG call today … the skinny:
@dibyom @khrm please comment as needed if my summary missed something
After investigating and thinking about this a bit more, I think the TL;DR is:
afaik @pmorie is pointing out that in our current design, if a user can create an EventListener (with a serviceaccount that can make PipelineRuns, read TriggerBindings, etc.), and you can create Pipelines + Tasks, they’ll then have additionally the ability to:
So basically for example you might intend for a user to only be able to run Pipeline Foo in a cluster in response to a webhook, but you may not realize you actually gave the user the ability to do nearly anything they want in the cluster.
I’m not sure triggers or pipelines should solve this directly, but we might want to provide some guidance (and maybe even best practice setup Tasks like the one @akihikokuroda added!) for ppl to setup secure clusters, e.g. something like:
SubjectAccessReviewto express stuff like: in order for a user to be allowed to make anEventListener, they must also be allowed to create aPipelineRun(and if you want to create aPipelineRun, you need to be allowed to create apod)blahcan only be referenced inpodsthat are created by userbaz