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

Limit privilege scope for Compass Manager #167

Merged
merged 9 commits into from
May 13, 2024

Conversation

mvshao
Copy link
Contributor

@mvshao mvshao commented May 9, 2024

Description
Limit scope for Compass Manager from cluster-wide to namespace-wide (kcp-system) privileges

Changes proposed in this pull request:

  • change RBACs from ClusterRole to Role
  • code adjustments to restrict the controller to only work in kcp-system namespace context

Related issue(s)
#155

@mvshao mvshao requested a review from a team as a code owner May 9, 2024 07:12
@kyma-bot kyma-bot added cla: yes Indicates the PR's author has signed the CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 9, 2024
@kyma-bot kyma-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 9, 2024
@kyma-bot kyma-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 9, 2024
@@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= compass-manager:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.26.0
ENVTEST_K8S_VERSION = 1.28.0
Copy link
Contributor

Choose a reason for hiding this comment

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

could we use highest currently supported by our gardener, 1.29.3?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Compass Manager was tested to support the 1.28.x version (the same version as in our enviroments)

@@ -10,6 +10,7 @@ metadata:
app.kubernetes.io/part-of: compass-manager
app.kubernetes.io/managed-by: kustomize
name: compassmanager-editor-role
namespace: kcp-system
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we maybe set all the namespaces with a kustomize, if multiple resources have the same namespace?

Copy link
Contributor Author

@mvshao mvshao May 13, 2024

Choose a reason for hiding this comment

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

We can leave this as it is. It increase the readability of the resources. But in our environment charts I used the Kustomize to fill this field.

@@ -1,5 +1,5 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
kind: RoleBinding
metadata:
labels:
app.kubernetes.io/name: clusterrolebinding
Copy link
Contributor

Choose a reason for hiding this comment

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

this is no longer a ClusterRoleBinding

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will change it

@@ -1,18 +1,10 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
kind: Role
metadata:
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this role also have labels connecting it with compass-manager?

@kyma-bot kyma-bot added the lgtm Looks good to me! label May 13, 2024
@kyma-bot kyma-bot merged commit 88072e3 into kyma-project:main May 13, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indicates the PR's author has signed the CLA. lgtm Looks good to me! size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants