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

[feat] Kratix should warn when a Promise RBAC specifies a namespaced permissions for a cluster-wide resource #214

Open
aclevername opened this issue Aug 5, 2024 · 0 comments
Assignees

Comments

@aclevername
Copy link
Member

aclevername commented Aug 5, 2024

If a resource is cluster wide, e.g. Destinations, you must ensure that you use a ClusterRole instead of a Role to give permissions to it. In the rbac.permissions feature this is done by setting resourceNamespace: "*", which could easily be forgotten.

Example:

            rbac:
              permissions:
              - apiGroups:
                  - platform.kratix.io
                resources:
                  - destinations
                verbs:
                  - list

this will create a Role/RoleBinding, however the Role will be useless, since it refererences a cluster-wide resource that isn't namespaced. We should emit a warning/error on validating webhook when this happens, and suggest that they change it to:

            rbac:
              permissions:
              - apiGroups:
                  - platform.kratix.io
                resources:
                  - destinations
                verbs:
                  - list
                resourceNamespace: "*"
@richcooper95 richcooper95 self-assigned this Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants