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

Namespace-scoped leases permissions #1614

Merged
merged 1 commit into from
Jun 7, 2023

Conversation

torredil
Copy link
Member

@torredil torredil commented May 24, 2023

This PR addresses the overly broad permissions previously granted to the
AWS EBS CSI driver for managing 'leases'. It replaces the ClusterRole and
ClusterRoleBinding, which provided cluster-wide access, with a Role and
RoleBinding, limiting access to the namespace in which the driver is deployed.

What is this PR about? / Why do we need it?

The original configuration granted the driver access to leases across all
namespaces, which was unnecessary. By limiting access to the namespace in which the driver is deployed, we can enhance our security posture.

closes #1564

What testing is done?

  • CI
  • Manual testing

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 24, 2023
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 24, 2023
@torredil torredil requested a review from hanyuel May 24, 2023 20:45
@torredil
Copy link
Member Author

/retest

@rdpsin
Copy link
Contributor

rdpsin commented May 25, 2023

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 25, 2023
@jacobwolfaws
Copy link
Contributor

/lgtm

Copy link
Contributor

@ConnorJC3 ConnorJC3 left a comment

Choose a reason for hiding this comment

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

One nit, otherwise lgtm

deploy/kubernetes/base/role-leases.yaml Outdated Show resolved Hide resolved
deploy/kubernetes/base/rolebinding-leases.yaml Outdated Show resolved Hide resolved
@hanyuel
Copy link
Contributor

hanyuel commented Jun 5, 2023

/lgtm

This commit modifies the driver's access to the 'leases' resource, restricting it to the namespace scope.

The previously used ClusterRole and ClusterRoleBinding have been replaced by a Role and RoleBinding to ensure the driver's permissions are limited to its containing namespace, aligning with security best practices.

Signed-off-by: Eddie Torres <torredil@amazon.com>
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 5, 2023
@rdpsin
Copy link
Contributor

rdpsin commented Jun 6, 2023

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 6, 2023
@torredil
Copy link
Member Author

torredil commented Jun 7, 2023

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: torredil

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

The pull request process is described 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 7, 2023
@k8s-ci-robot k8s-ci-robot merged commit 1972d10 into kubernetes-sigs:master Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

overly broad permissions: leases permissions should be namespace scoped
6 participants