Skip to content

Commit f4aca92

Browse files
authored
Merge pull request #39286 from Zhuzhenghao/cleanup/api-server-bypass-risks
Clean up api-server-bypass-risks.md
2 parents aee5e26 + 42e746a commit f4aca92

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

content/en/docs/concepts/security/api-server-bypass-risks.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ weight: 90
88

99
<!-- overview -->
1010

11-
The Kubernetes API server is the main point of entry to a cluster for external parties
12-
(users and services) interacting with it.
11+
The Kubernetes API server is the main point of entry to a cluster for external parties
12+
(users and services) interacting with it.
1313

1414
As part of this role, the API server has several key built-in security controls, such as
1515
audit logging and {{< glossary_tooltip text="admission controllers" term_id="admission-controller" >}}.
@@ -48,13 +48,13 @@ API server. However, the Pod still runs on the node. For more information, refer
4848
### Mitigations {#static-pods-mitigations}
4949

5050
- Only [enable the kubelet static Pod manifest functionality](/docs/tasks/configure-pod-container/static-pod/#static-pod-creation)
51-
if required by the node.
51+
if required by the node.
5252
- If a node uses the static Pod functionality, restrict filesystem access to the static Pod manifest directory
53-
or URL to users who need the access.
53+
or URL to users who need the access.
5454
- Restrict access to kubelet configuration parameters and files to prevent an attacker setting
55-
a static Pod path or URL.
55+
a static Pod path or URL.
5656
- Regularly audit and centrally report all access to directories or web storage locations that host
57-
static Pod manifests and kubelet configuration files.
57+
static Pod manifests and kubelet configuration files.
5858

5959
## The kubelet API {#kubelet-api}
6060

@@ -73,7 +73,7 @@ Direct access to the kubelet API is not subject to admission control and is not
7373
by Kubernetes audit logging. An attacker with direct access to this API may be able to
7474
bypass controls that detect or prevent certain actions.
7575

76-
The kubelet API can be configured to authenticate requests in a number of ways.
76+
The kubelet API can be configured to authenticate requests in a number of ways.
7777
By default, the kubelet configuration allows anonymous access. Most Kubernetes providers
7878
change the default to use webhook and certificate authentication. This lets the control plane
7979
ensure that the caller is authorized to access the `nodes` API resource or sub-resources.
@@ -86,7 +86,7 @@ The default anonymous access doesn't make this assertion with the control plane.
8686
such as by monitoring services.
8787
- Restrict access to the kubelet port. Only allow specified and trusted IP address
8888
ranges to access the port.
89-
- Ensure that [kubelet authentication](/docs/reference/access-authn-authz/kubelet-authn-authz/#kubelet-authentication).
89+
- Ensure that [kubelet authentication](/docs/reference/access-authn-authz/kubelet-authn-authz/#kubelet-authentication).
9090
is set to webhook or certificate mode.
9191
- Ensure that the unauthenticated "read-only" Kubelet port is not enabled on the cluster.
9292

@@ -108,7 +108,7 @@ cluster admin rights by accessing cluster secrets or modifying access rules. Eve
108108
elevating their Kubernetes RBAC privileges, an attacker who can modify etcd can retrieve any API object
109109
or create new workloads inside the cluster.
110110

111-
Many Kubernetes providers configure
111+
Many Kubernetes providers configure
112112
etcd to use mutual TLS (both client and server verify each other's certificate for authentication).
113113
There is no widely accepted implementation of authorization for the etcd API, although
114114
the feature exists. Since there is no authorization model, any certificate
@@ -124,10 +124,9 @@ that are only used for health checking can also grant full read and write access
124124
- Consider restricting access to the etcd port at a network level, to only allow access
125125
from specified and trusted IP address ranges.
126126

127-
128127
## Container runtime socket {#runtime-socket}
129128

130-
On each node in a Kubernetes cluster, access to interact with containers is controlled
129+
On each node in a Kubernetes cluster, access to interact with containers is controlled
131130
by the container runtime (or runtimes, if you have configured more than one). Typically,
132131
the container runtime exposes a Unix socket that the kubelet can access. An attacker with
133132
access to this socket can launch new containers or interact with running containers.
@@ -139,12 +138,12 @@ control plane components.
139138

140139
### Mitigations {#runtime-socket-mitigations}
141140

142-
- Ensure that you tightly control filesystem access to container runtime sockets.
143-
When possible, restrict this access to the `root` user.
141+
- Ensure that you tightly control filesystem access to container runtime sockets.
142+
When possible, restrict this access to the `root` user.
144143
- Isolate the kubelet from other components running on the node, using
145-
mechanisms such as Linux kernel namespaces.
144+
mechanisms such as Linux kernel namespaces.
146145
- Ensure that you restrict or forbid the use of [`hostPath` mounts](/docs/concepts/storage/volumes/#hostpath)
147-
that include the container runtime socket, either directly or by mounting a parent
148-
directory. Also `hostPath` mounts must be set as read-only to mitigate risks
149-
of attackers bypassing directory restrictions.
146+
that include the container runtime socket, either directly or by mounting a parent
147+
directory. Also `hostPath` mounts must be set as read-only to mitigate risks
148+
of attackers bypassing directory restrictions.
150149
- Restrict user access to nodes, and especially restrict superuser access to nodes.

0 commit comments

Comments
 (0)