apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: falco-event-generator
rules:
- apiGroups:
  - ""
  resources:
  - configmaps
  - services
  - serviceaccounts
  - pods
  verbs:
  - list
  - get
  - create
  - delete
- apiGroups:
  - apps
  - extensions
  resources:
  - deployments
  verbs:
  - list
  - get
  - create
  - delete
- apiGroups:
  - rbac.authorization.k8s.io
  resources:
  - roles
  - rolebindings
  verbs:
  - get
  - list
  - create
  - delete
# These are only so the event generator can create roles that have these properties.
# It will result in a falco alert for the rules "ClusterRole With Wildcard Created", "ClusterRole With Pod Exec Created"
- apiGroups:
  - ""
  resources:
  - pods/exec
  verbs:
  - get
- apiGroups:
  - ""
  resources:
  - '*'
  verbs:
  - get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: falco-event-generator
  namespace: falco-eg-sandbox
subjects:
  - kind: ServiceAccount
    name: falco-event-generator
    namespace: falco-event-generator
roleRef:
  kind: ClusterRole
  name: falco-event-generator
  apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: falco-event-generator
  namespace: falco-event-generator
