Skip to content

Commit acc7252

Browse files
authored
Merge pull request #29025 from robscott/endpoints-rbac
Adding documentation about Endpoints write access in wake of CVE-2021-25740
2 parents cfce358 + d710925 commit acc7252

File tree

2 files changed

+44
-3
lines changed

2 files changed

+44
-3
lines changed

content/en/docs/reference/access-authn-authz/rbac.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Because ClusterRoles are cluster-scoped, you can also use them to grant access t
8686
* cluster-scoped resources (like {{< glossary_tooltip text="nodes" term_id="node" >}})
8787
* non-resource endpoints (like `/healthz`)
8888
* namespaced resources (like Pods), across all namespaces
89-
89+
9090
For example: you can use a ClusterRole to allow a particular user to run
9191
`kubectl get pods --all-namespaces`
9292

@@ -685,7 +685,10 @@ When used in a <b>RoleBinding</b>, it gives full control over every resource in
685685
<td>Allows admin access, intended to be granted within a namespace using a <b>RoleBinding</b>.
686686
If used in a <b>RoleBinding</b>, allows read/write access to most resources in a namespace,
687687
including the ability to create roles and role bindings within the namespace.
688-
This role does not allow write access to resource quota or to the namespace itself.</td>
688+
This role does not allow write access to resource quota or to the namespace itself.
689+
This role also does not allow write access to Endpoints in clusters created
690+
using Kubernetes v1.22+. More information is available in the ["Write Access for
691+
Endpoints" section](#write-access-for-endpoints).</td>
689692
</tr>
690693
<tr>
691694
<td><b>edit</b></td>
@@ -695,7 +698,9 @@ This role does not allow write access to resource quota or to the namespace itse
695698
This role does not allow viewing or modifying roles or role bindings.
696699
However, this role allows accessing Secrets and running Pods as any ServiceAccount in
697700
the namespace, so it can be used to gain the API access levels of any ServiceAccount in
698-
the namespace.</td>
701+
the namespace. This role also does not allow write access to Endpoints in
702+
clusters created using Kubernetes v1.22+. More information is available in the
703+
["Write Access for Endpoints" section](#write-access-for-endpoints).</td>
699704
</tr>
700705
<tr>
701706
<td><b>view</b></td>
@@ -1185,6 +1190,24 @@ In order from most secure to least secure, the approaches are:
11851190
--group=system:serviceaccounts
11861191
```
11871192

1193+
## Write access for Endpoints
1194+
1195+
Kubernetes clusters created before Kubernetes v1.22 include write access to
1196+
Endpoints in the aggregated "edit" and "admin" roles. As a mitigation for
1197+
[CVE-2021-25740](https://github.com/kubernetes/kubernetes/issues/103675), this
1198+
access is not part of the aggregated roles in clusters that you create using
1199+
Kubernetes v1.22 or later.
1200+
1201+
Existing clusters that have been upgraded to Kubernetes v1.22 will not be
1202+
subject to this change. The [CVE
1203+
announcement](https://github.com/kubernetes/kubernetes/issues/103675) includes
1204+
guidance for restricting this access in existing clusters.
1205+
1206+
If you want new clusters to retain this level of access in the aggregated roles,
1207+
you can create the following ClusterRole:
1208+
1209+
{{< codenew file="access/endpoints-aggregated.yaml" >}}
1210+
11881211
## Upgrading from ABAC
11891212

11901213
Clusters that originally ran older Kubernetes versions often used
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
annotations:
5+
kubernetes.io/description: |-
6+
Add endpoints write permissions to the edit and admin roles. This was
7+
removed by default in 1.22 because of CVE-2021-25740. See
8+
https://issue.k8s.io/103675. This can allow writers to direct LoadBalancer
9+
or Ingress implementations to expose backend IPs that would not otherwise
10+
be accessible, and can circumvent network policies or security controls
11+
intended to prevent/isolate access to those backends.
12+
labels:
13+
rbac.authorization.k8s.io/aggregate-to-edit: "true"
14+
name: custom:aggregate-to-edit:endpoints # you can change this if you wish
15+
rules:
16+
- apiGroups: [""]
17+
resources: ["endpoints"]
18+
verbs: ["create", "delete", "deletecollection", "patch", "update"]

0 commit comments

Comments
 (0)