Repository navigation
Description
Is your feature request related to a problem ?
Follow up to #1420
The Dashboard API (provided by the Kubernetes API server) respects the configured RBAC, whether using the Dashboard ServiceAccount (default) or via user impersonation. This means that a user accessing the Dashboard can only access and act on the resources to which they (or the Dashboard ServiceAccount) are granted the relevant permissions. In case of forbidden access the Dashboard will display corresponding errors to the user.
The Dashboard also provides a 'read-only' mode with restricted RBAC. This mode is reflected in the UI by hiding any navigation items or other controls that require write access, e.g. Import resources, Create PipelineRun, delete, rerun, etc.
However, if a user/admin customises the RBAC, or enables user impersonation, the UI does not reflect this. All navigation items / controls are available in the UI and the user is presented with corresponding errors for any actions they not have permission to perform. It would be a much better user experience to only show the navigation items and controls the user has permission to use, thus avoiding these errors.
Describe the solution you'd like
The Kubernetes API server provides a number of mechanisms for checking API access
The most appropriate of these seems to be:
SelfSubjectRulesReview- A review which returns the set of actions a user can perform within a namespace. Useful for users to quickly summarize their own access, or for UIs to hide/show actions.
The Dashboard client should use this to determine which elements to make available in the UI.
Describe alternatives you've considered
SelfSubjectAccessReview allows a user to query whether or not they have permission to perform a given action, e.g. create a deployment in the dev namespace.
This may be useful in specific targeted cases but is unlikely to work well as a more general solution as it would require many requests on page load / navigation.
Additional context
Note: SelfSubjectRulesReview is scoped to a single namespace so additional work is required to handle the 'All namespaces' option in the global namespaces filter.
Consideration should also be given to caching responses for some period to avoid the need to query access on every navigation. This would be purely a client optimisation to avoid unnecessary network traffic, the actual RBAC configured on the cluster would still apply to the API calls.
How would we handle cases where a user doesn't have permission to list namespaces? One option is to prompt them to enter a namespace and then we could persist that in browser storage and use it to populate the namespaces dropdown / selected global namespace filter. For these users we should probably remove/disable the 'All namespaces' option.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTodo
Activity
tekton-robot commentedon Apr 17, 2022
Issues go stale after 90d of inactivity.
Mark the issue as fresh with
/remove-lifecycle stalewith a justification.Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with
/closewith a justification.If this issue should be exempted, mark the issue as frozen with
/lifecycle frozenwith a justification./lifecycle stale
Send feedback to tektoncd/plumbing.
AlanGreene commentedon Apr 17, 2022
This is still something we want to do .
/lifecycle frozen
DrissiReda commentedon Apr 17, 2022
@AlanGreene is it a priority? If not, when do you think it’s going to be handled.
AlanGreene commentedon Feb 10, 2023
Apologies for not replying sooner, I must have missed the notification. It's not currently a high priority but is something we would like to get to eventually. The highest priority items at the moment are currency (supporting latest Pipeline features) and consistency (common actions / presentation of resources, ensuring all *Run resources have similar support for creation etc.).
This issue will become more important to provide clean support for #1388 and also opens up some other interesting possibilities in future so it is still something we'd love to add.
solidDoWant commentedon Nov 14, 2026
I'm hitting a similar issue. I'm currently only giving the dashboard access to specific project namespaces via k8s RBAC, along with namespace list+watch. Right now, I need to update the
--namespacesflag every time I add/remove a project. Without this, the dashboard namespace dropdown lists every namespace, and errors when selecting namespaces that it doesn't have permission to read.I'd be willing to contribute PR(s) for either of the following fixes:
--namespace-selector=example.com/tekton-dashboard=true. This would decouple namespace additions/removals from my dashboard config. I think client-go provides a helper for this that should make implementation very straightforward.SelfSubjectRulesReviewon every namespace. This would be a more complex solution, but more automatic for users.Would PRs for either of these features be accepted?
AlanGreene commentedon Nov 16, 2026
Hi @solidDoWant, thanks for your interest.
I'd like to understand your setup and use case a bit better:
If you're restricting the Dashboard to a subset of namespaces using
--namespacesas you've mentioned, then you shouldn't need to give it namespace list+watch permission and can remove namespaces from the defaulttekton-dashboard-tenant-viewClusterRole or whatever config you have in place.How many projects are you working with and how frequently does the list change? What does the process of adding or removing a project currently look like in a broader sense? Have you considered automation around this process that could also update the Dashboard config at the same time?
As for your specific proposals:
See #2172 (comment) for details of why this is not an approach we'll be pursuing.
Deriving the list would require the Dashboard service account to always have permission to list all namespaces, which goes against our current minimal RBAC approach. The Dashboard service account (or user when using impersonation) must either be granted permission to list namespaces, or the desired subset of namespaces to display must be provided via config. These are the only supported scenarios and this stance is unlikely to change in the near term.
The use of
SelfSubjectRulesReviewas proposed in the issue description is still the preferred approach but requires careful design before beginning implementation.Some things to consider:
solidDoWant commentedon Nov 16, 2026
Thanks! Didn't realize that.
Right now, about a dozen. Right now with how cheap and generally useful LLMs are, I'm "writing" (and maintaining) a project every week or so. Today my project setup process is entirely contained in a Helm chart, so adding or removing a project is as simple as adding/removing a Helm release file (I use FluxCD/GitOps), and updating any "coupled" config sites like the dashboard
--namespacesflag.I certainly could setup my own automation for this. I'll probably go this route if there isn't a clear solution here - I just thought that this might benefit other users, so figured I'd see if the project was interested in this.
Maybe another solution here would be to add this to the Tekton Operator
TektonDashboardresource. The downside would be that the application would need to restart every time the list changed. This doesn't bother me, but other folks that change their list more frequently may take issue with this.Thanks, hadn't seen that comment before. It does look like the dashboard has this permission by default. I completely get and respect that the goal here is to minimize permissions required. Maybe a solution here would be to only require namespace list+watch if a namespace selector flag is used? This wouldn't raise the RBAC permissions required for the current
--namespacespath, nor the default install, while still addressing the issue. The flags would be "xor", matching the currently supported scenarios from a security perspective. How does this sound?Regarding the
SelfSubjectRulesReview, I think this requires specifying a namespace so even with this approach namespace list+watch would be required.