Skip to content

Commit e25a0b6

Browse files
authored
using specific verbs to replace wildcards (#137)
1 parent ba87f5e commit e25a0b6

File tree

2 files changed

+34
-6
lines changed

2 files changed

+34
-6
lines changed

README.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,25 @@ When the `NamespaceScope` CR is created/updated, it will:
9696
namespace: FROM_namespaceMembers
9797
rules:
9898
- apiGroups:
99-
- '*'
99+
- "*"
100100
resources:
101-
- '*'
101+
- "*"
102102
verbs:
103-
- '*'
103+
- create
104+
- delete
105+
- get
106+
- list
107+
- patch
108+
- update
109+
- watch
110+
- deletecollection
111+
- apiGroups:
112+
- rbac.authorization.k8s.io
113+
resources:
114+
- roles
115+
verbs:
116+
- escalate
117+
- bind
104118
---
105119
kind: RoleBinding
106120
apiVersion: rbac.authorization.k8s.io/v1
@@ -225,13 +239,13 @@ WHERE:
225239

226240
```
227241
228-
For example, if you want to grant namespace admin permission of `common-service` to the service account in `ibm-common-services` namespace, you can use the following command
242+
For example, if you want to grant the namespace scope permission of `common-service` to the service account in `ibm-common-services` namespace, you can use the following command
229243
230244
```bash
231245
scripts/authorize-namespace.sh common-service
232246
```
233247

234-
if you want to revoke this namespace admin permission, you can use the following command
248+
if you want to revoke this namespace scope permission, you can use the following command
235249

236250
```bash
237251
scripts/authorize-namespace.sh common-service -delete

scripts/authorize-namespace.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,21 @@ rules:
135135
resources:
136136
- "*"
137137
verbs:
138-
- "*"
138+
- create
139+
- delete
140+
- get
141+
- list
142+
- patch
143+
- update
144+
- watch
145+
- deletecollection
146+
- apiGroups:
147+
- rbac.authorization.k8s.io
148+
resources:
149+
- roles
150+
verbs:
151+
- escalate
152+
- bind
139153
EOF
140154

141155
#

0 commit comments

Comments
 (0)