Skip to content

Commit 5ad2832

Browse files
authored
Merge pull request #37424 from windsonsea/rbacy
[zh] sync /access-authn-authz/rbac.md
2 parents d2be416 + ccc2f36 commit 5ad2832

File tree

1 file changed

+18
-20
lines changed
  • content/zh-cn/docs/reference/access-authn-authz

1 file changed

+18
-20
lines changed

content/zh-cn/docs/reference/access-authn-authz/rbac.md

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,7 @@ secrets in any namespace.
380380
#### ClusterRoleBinding 示例 {#clusterrolebinding-example}
381381

382382
要跨整个集群完成访问权限的授予,你可以使用一个 ClusterRoleBinding。
383-
下面的 ClusterRoleBinding 允许 "manager" 组内的所有用户访问任何名字空间中的
384-
Secrets。
383+
下面的 ClusterRoleBinding 允许 "manager" 组内的所有用户访问任何名字空间中的 Secret。
385384

386385
<!--
387386
```yaml
@@ -446,7 +445,7 @@ the new role (as opposed to enabling or accidentally modifying only the roleRef
446445
without verifying all of the existing subjects should be given the new role's
447446
permissions).
448447
-->
449-
2. 针对不同角色的绑定是完全不一样的绑定。要求通过删除/重建绑定来更改 `roleRef`,
448+
2. 针对不同角色的绑定是完全不一样的绑定。要求通过删除/重建绑定来更改 `roleRef`
450449
这样可以确保要赋予绑定的所有主体会被授予新的角色(而不是在允许或者不小心修改了
451450
`roleRef` 的情况下导致所有现有主体未经验证即被授予新角色对应的权限)。
452451

@@ -602,7 +601,6 @@ only the permissions required for the workload to function correctly are applied
602601
使用具体的 resources 和 verbs 确保仅赋予工作负载正常运行所需的权限。
603602
{{< /caution >}}
604603

605-
606604
<!--
607605
### Aggregated ClusterRoles
608606

@@ -672,7 +670,7 @@ metadata:
672670
# the rules below will be added to the "monitoring" ClusterRole.
673671
rules:
674672
- apiGroups: [""]
675-
resources: ["services", "endpoints", "pods"]
673+
resources: ["services", "endpointslices", "pods"]
676674
verbs: ["get", "list", "watch"]
677675
```
678676
-->
@@ -687,7 +685,7 @@ metadata:
687685
# 下面的规则会被添加到 "monitoring" ClusterRole 中
688686
rules:
689687
- apiGroups: [""]
690-
resources: ["services", "endpoints", "pods"]
688+
resources: ["services", "endpointslices", "pods"]
691689
verbs: ["get", "list", "watch"]
692690
```
693691

@@ -1327,17 +1325,17 @@ Allows admin access, intended to be granted within a namespace using a <b>RoleBi
13271325
If used in a <b>RoleBinding</b>, allows read/write access to most resources in a namespace,
13281326
including the ability to create roles and role bindings within the namespace.
13291327
This role does not allow write access to resource quota or to the namespace itself.
1330-
This role also does not allow write access to Endpoints in clusters created
1328+
This role also does not allow write access to EndpointSlices (or Endpoints) in clusters created
13311329
using Kubernetes v1.22+. More information is available in the
1332-
["Write Access for Endpoints" section](#write-access-for-endpoints).
1330+
["Write Access for EndpointSlices and Endpoints" section](#write-access-for-endpoints).
13331331
-->
13341332
允许管理员访问权限,旨在使用 <b>RoleBinding</b> 在名字空间内执行授权。
13351333

13361334
如果在 <b>RoleBinding</b> 中使用,则可授予对名字空间中的大多数资源的读/写权限,
13371335
包括创建角色和角色绑定的能力。
13381336
此角色不允许对资源配额或者名字空间本身进行写操作。
1339-
此角色也不允许对 Kubernetes v1.22+ 创建的 Endpoints 进行写操作。
1340-
更多信息参阅 [“Endpoints 写权限”小节](#write-access-for-endpoints)。
1337+
此角色也不允许对 Kubernetes v1.22+ 创建的 EndpointSlices(或 Endpoints)进行写操作。
1338+
更多信息参阅 [“EndpointSlices 和 Endpoints 写权限”小节](#write-access-for-endpoints)。
13411339
</td>
13421340
</tr>
13431341
<tr>
@@ -1352,17 +1350,17 @@ Allows read/write access to most objects in a namespace.
13521350
This role does not allow viewing or modifying roles or role bindings.
13531351
However, this role allows accessing Secrets and running Pods as any ServiceAccount in
13541352
the namespace, so it can be used to gain the API access levels of any ServiceAccount in
1355-
the namespace. This role also does not allow write access to Endpoints in
1353+
the namespace. This role also does not allow write access to EndpointSlices (or Endpoints) in
13561354
clusters created using Kubernetes v1.22+. More information is available in the
1357-
["Write Access for Endpoints" section](#write-access-for-endpoints).
1355+
["Write Access for EndpointSlices and Endpoints" section](#write-access-for-endpoints).
13581356
-->
13591357
允许对名字空间的大多数对象进行读/写操作。
13601358

13611359
此角色不允许查看或者修改角色或者角色绑定。
13621360
不过,此角色可以访问 Secret,以名字空间中任何 ServiceAccount 的身份运行 Pod,
13631361
所以可以用来了解名字空间内所有服务账户的 API 访问级别。
1364-
此角色也不允许对 Kubernetes v1.22+ 创建的 Endpoints 进行写操作。
1365-
更多信息参阅 [“Endpoints 写操作”小节](#write-access-for-endpoints)。
1362+
此角色也不允许对 Kubernetes v1.22+ 创建的 EndpointSlices(或 Endpoints)进行写操作。
1363+
更多信息参阅 [“EndpointSlices 和 Endpoints 写操作”小节](#write-access-for-endpoints)。
13661364
</td>
13671365
</tr>
13681366
<tr>
@@ -2258,18 +2256,18 @@ In order from most secure to least secure, the approaches are:
22582256
```
22592257

22602258
<!--
2261-
## Write access for Endpoints
2259+
## Write access for EndpointSlices and Endpoints {#write-access-for-endpoints}
22622260

22632261
Kubernetes clusters created before Kubernetes v1.22 include write access to
2264-
Endpoints in the aggregated "edit" and "admin" roles. As a mitigation for
2265-
[CVE-2021-25740](https://github.com/kubernetes/kubernetes/issues/103675), this
2266-
access is not part of the aggregated roles in clusters that you create using
2262+
EndpointSlices (and Endpoints) in the aggregated "edit" and "admin" roles.
2263+
As a mitigation for [CVE-2021-25740](https://github.com/kubernetes/kubernetes/issues/103675),
2264+
this access is not part of the aggregated roles in clusters that you create using
22672265
Kubernetes v1.22 or later.
22682266
-->
2269-
## Endpoints 写权限 {#write-access-for-endpoints}
2267+
## EndpointSlices 和 Endpoints 写权限 {#write-access-for-endpoints}
22702268

22712269
在 Kubernetes v1.22 之前版本创建的集群里,
2272-
“edit” 和 “admin” 聚合角色包含对 Endpoints 的写权限。
2270+
“edit” 和 “admin” 聚合角色包含对 EndpointSlices(和 Endpoints)的写权限。
22732271
作为 [CVE-2021-25740](https://github.com/kubernetes/kubernetes/issues/103675) 的缓解措施,
22742272
此访问权限不包含在 Kubernetes 1.22 以及更高版本集群的聚合角色里。
22752273

0 commit comments

Comments
 (0)