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

Add rbac removal for when auth with proxy #2291

Closed
wants to merge 1 commit into from
Closed

Conversation

mlbiam
Copy link
Contributor

@mlbiam mlbiam commented Jan 19, 2022

Changes

Updated docs with RBAC for least privileged access when using a reverse proxy for authentication

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

See the contribution guide
for more details.

@tekton-robot tekton-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 19, 2022
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 19, 2022

CLA Signed

The committers are authorized under a signed CLA.

@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign alangreene
You can assign the PR to them by writing /assign @alangreene in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot
Copy link
Contributor

Hi @mlbiam. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tekton-robot tekton-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 19, 2022
Copy link
Member

@AlanGreene AlanGreene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @mlbiam
/ok-to-test

@@ -199,6 +199,21 @@ By default the Dashboard accesses resources and performs actions in the cluster

Typically when configuring impersonation you would have the proxy forward its ServiceAccount token in the `Authorization` header, and details of the user and groups in the `Impersonate-User` and `Impersonate-Group` headers respectively. See the docs of your chosen solution for details.

When using a reverse proxy, with impersonation headers or the user's account, you should remove the dashboard's privileges to better maintain a "least privileged" approach. This will make it less likely that the dashboard's `ServiceAccount` will be abused:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
When using a reverse proxy, with impersonation headers or the user's account, you should remove the dashboard's privileges to better maintain a "least privileged" approach. This will make it less likely that the dashboard's `ServiceAccount` will be abused:
When using a reverse proxy, with impersonation headers or the user's account, you should remove the Dashboard's privileges to better maintain a "least privileged" approach. This will make it less likely that the Dashboard's `ServiceAccount` will be abused:

Comment on lines +205 to +214
kubectl delete clusterrole tekton-dashboard-backend
kubectl delete clusterrole tekton-dashboard-dashboard
kubectl delete clusterrole tekton-dashboard-pipelines
kubectl delete clusterrole tekton-dashboard-tenant
kubectl delete clusterrole tekton-dashboard-triggers
kubectl delete clusterrolebinding tekton-dashboard-backend
kubectl delete rolebinding tekton-dashboard-pipelines -n tekton-pipelines
kubectl delete rolebinding tekton-dashboard-dashboard -n tekton-pipelines
kubectl delete rolebinding tekton-dashboard-triggers -n tekton-pipelines
kubectl delete clusterrolebinding tekton-dashboard-tenant
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should consider adding a label to these resources to more easily target them for deletion and avoid having to keep this list up to date. What do you think? e.g. rbac.dashboard.tekton.dev/default: true or similar so we could kubectl delete clusterrole -l rbac.dashboard.tekton.dev/default=true etc.

Technically only the bindings need to be deleted, so maybe rbac.dashboard.tekton.dev/subject: tekton-dashboard or similar would be more suitable on those, to make it clear we're removing the default permissions granted the Dashboard's SA.

I think we'll likely add an additional manifest (or at least an installer script flag) in future to install the Dashboard without these resources. This would probably make sense as part of the remaining work to improve the experience with custom RBAC, impersonation, etc.

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 19, 2022
@AlanGreene
Copy link
Member

Thanks again for the PR @mlbiam. I've opened a new PR #2309 implementing my suggestion from above and added you as a co-author. Closing this one.

@AlanGreene AlanGreene closed this Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants