|
| 1 | +analytics: |
| 2 | + disable: true |
| 3 | + |
| 4 | +rbac: |
| 5 | + create: true |
| 6 | + rules: |
| 7 | + - apiGroups: [ "*" ] |
| 8 | + resources: [ "*" ] |
| 9 | + verbs: [ "get", "watch", "list" ] # defaults |
| 10 | + staticGroupName: "botkube-plugins-default" |
| 11 | + |
| 12 | +extraObjects: |
| 13 | + |
| 14 | + # Group 'kubectl-first-channel': permissions for kubectl for first channel |
| 15 | + ## namespace scoped permissions |
| 16 | + - apiVersion: rbac.authorization.k8s.io/v1 |
| 17 | + kind: ClusterRole |
| 18 | + metadata: &kubectl-wait |
| 19 | + name: kubectl-first-channel-namespaced-perms |
| 20 | + labels: |
| 21 | + app.kubernetes.io/instance: botkube-e2e-test |
| 22 | + rules: |
| 23 | + - apiGroups: [ "apps" ] |
| 24 | + resources: [ "deployments" ] |
| 25 | + verbs: [ "get","watch","list" ] |
| 26 | + - apiGroups: [ "" ] |
| 27 | + resources: [ "configmaps", "pods" ] |
| 28 | + verbs: [ "get", "watch", "list" ] |
| 29 | + - apiVersion: rbac.authorization.k8s.io/v1 |
| 30 | + kind: RoleBinding |
| 31 | + metadata: |
| 32 | + <<: *kubectl-wait |
| 33 | + namespace: botkube |
| 34 | + roleRef: &kubectl-wait-role |
| 35 | + apiGroup: rbac.authorization.k8s.io |
| 36 | + kind: ClusterRole |
| 37 | + name: kubectl-first-channel-namespaced-perms |
| 38 | + subjects: &kubectl-first-channel-subject |
| 39 | + - kind: User |
| 40 | + name: kubectl-first-channel |
| 41 | + apiGroup: rbac.authorization.k8s.io |
| 42 | + - apiVersion: rbac.authorization.k8s.io/v1 |
| 43 | + kind: RoleBinding |
| 44 | + metadata: |
| 45 | + <<: *kubectl-wait |
| 46 | + namespace: default |
| 47 | + roleRef: *kubectl-wait-role |
| 48 | + subjects: *kubectl-first-channel-subject |
| 49 | + |
| 50 | + ### cluster permissions |
| 51 | + - apiVersion: rbac.authorization.k8s.io/v1 |
| 52 | + kind: ClusterRole |
| 53 | + metadata: &kubectl-deploy-all-meta |
| 54 | + name: kc-first-channel-cluster-perms |
| 55 | + labels: |
| 56 | + app.kubernetes.io/instance: botkube-e2e-test |
| 57 | + rules: |
| 58 | + - apiGroups: [ "apps" ] |
| 59 | + resources: [ "deployments" ] |
| 60 | + verbs: [ "get", "list" ] |
| 61 | + - apiVersion: rbac.authorization.k8s.io/v1 |
| 62 | + kind: ClusterRoleBinding |
| 63 | + metadata: *kubectl-deploy-all-meta |
| 64 | + roleRef: |
| 65 | + apiGroup: rbac.authorization.k8s.io |
| 66 | + kind: ClusterRole |
| 67 | + name: kc-first-channel-cluster-perms |
| 68 | + subjects: *kubectl-first-channel-subject |
| 69 | + |
| 70 | + # Group 'kc-exec-only' |
| 71 | + ## exec only for default and botkube namespaces: |
| 72 | + - apiVersion: rbac.authorization.k8s.io/v1 |
| 73 | + kind: ClusterRole |
| 74 | + metadata: &kc-exec-only-meta |
| 75 | + name: kc-exec-only |
| 76 | + labels: |
| 77 | + app.kubernetes.io/instance: botkube-e2e-test |
| 78 | + rules: |
| 79 | + - apiGroups: [ "" ] |
| 80 | + resources: [ "pods/exec" ] |
| 81 | + verbs: [ "create" ] |
| 82 | + - apiVersion: rbac.authorization.k8s.io/v1 |
| 83 | + kind: RoleBinding |
| 84 | + metadata: |
| 85 | + <<: *kc-exec-only-meta |
| 86 | + namespace: botkube |
| 87 | + roleRef: &kc-exec-only-role |
| 88 | + apiGroup: rbac.authorization.k8s.io |
| 89 | + kind: ClusterRole |
| 90 | + name: kc-exec-only |
| 91 | + subjects: &kc-exec-only-subject |
| 92 | + - kind: User |
| 93 | + name: kc-exec-only |
| 94 | + apiGroup: rbac.authorization.k8s.io |
| 95 | + - apiVersion: rbac.authorization.k8s.io/v1 |
| 96 | + kind: RoleBinding |
| 97 | + metadata: |
| 98 | + <<: *kc-exec-only-meta |
| 99 | + namespace: default |
| 100 | + roleRef: *kc-exec-only-role |
| 101 | + subjects: *kc-exec-only-subject |
| 102 | + |
| 103 | + # Group 'kc-label-svc-all': |
| 104 | + ## namespace scoped permissions |
| 105 | + - apiVersion: rbac.authorization.k8s.io/v1 |
| 106 | + kind: ClusterRole |
| 107 | + metadata: &kc-label-svc-all-meta |
| 108 | + name: kc-label-svc-all |
| 109 | + labels: |
| 110 | + app.kubernetes.io/instance: botkube-e2e-test |
| 111 | + rules: |
| 112 | + - apiGroups: [ "" ] |
| 113 | + resources: [ "services" ] |
| 114 | + verbs: [ "get", "patch" ] |
| 115 | + - apiVersion: rbac.authorization.k8s.io/v1 |
| 116 | + kind: ClusterRoleBinding |
| 117 | + metadata: *kc-label-svc-all-meta |
| 118 | + roleRef: |
| 119 | + apiGroup: rbac.authorization.k8s.io |
| 120 | + kind: ClusterRole |
| 121 | + name: kc-label-svc-all |
| 122 | + subjects: |
| 123 | + - kind: User |
| 124 | + name: kc-label-svc-all |
| 125 | + apiGroup: rbac.authorization.k8s.io |
| 126 | + |
| 127 | + # Group 'rbac-with-static-mapping': |
| 128 | + - apiVersion: rbac.authorization.k8s.io/v1 |
| 129 | + kind: ClusterRole |
| 130 | + metadata: &k8s-cm-watch-meta |
| 131 | + name: kc-watch-cm |
| 132 | + labels: |
| 133 | + app.kubernetes.io/instance: botkube-e2e-test |
| 134 | + rules: |
| 135 | + - apiGroups: [ "" ] |
| 136 | + resources: [ "configmaps" ] |
| 137 | + verbs: [ "watch", "list" ] |
| 138 | + - apiVersion: rbac.authorization.k8s.io/v1 |
| 139 | + kind: ClusterRoleBinding |
| 140 | + metadata: *k8s-cm-watch-meta |
| 141 | + roleRef: |
| 142 | + apiGroup: rbac.authorization.k8s.io |
| 143 | + kind: ClusterRole |
| 144 | + name: kc-watch-cm |
| 145 | + subjects: |
| 146 | + - kind: Group |
| 147 | + name: kc-watch-cm |
| 148 | + apiGroup: rbac.authorization.k8s.io |
0 commit comments