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

ClusterRole rules are too permissive #75

Closed
jameshearttech opened this issue Apr 28, 2023 · 3 comments · Fixed by #97
Closed

ClusterRole rules are too permissive #75

jameshearttech opened this issue Apr 28, 2023 · 3 comments · Fixed by #97

Comments

@jameshearttech
Copy link

role.yaml

{{- if .Values.rbac.create }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: {{ include "kubernetes-event-exporter.fullname" . }}
rules:
  - apiGroups: ["*"]
    resources: ["*"]
    verbs: ["get", "watch", "list"]
{{- end -}}

ClusterRole rules are too permissive! The service account does not need to be able to get, watch, list everything (e.g., secrets). The default should include only what is necessary for the software to function (i.e., events).

If we could configure the rules from the values.yaml that would be awesome.

@Evedel
Copy link

Evedel commented May 6, 2023

Under the hood, the exporter is using "EnhancedEvent". Meaning it is reading and attaching the whole InvolvedObject definition to the event. That is used for when one wants to customise payload. Which is why it needs read access to all objects referenced in events too.

@jpuskar
Copy link

jpuskar commented Jun 25, 2023

Would it be possible to toggle this functionality to allow the exporter to work in more restrictive environments?

@Evedel
Copy link

Evedel commented Jun 25, 2023

Hey @jpuskar, simply disabling that in the cluster role will break the exporter once an event is created with a custom resource as the object ref. You can try to drop the permissions and see you it is broken in your particular cluster. Actual code feature-toggle technically can be added.

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

Successfully merging a pull request may close this issue.

3 participants