Skip to content

Commit d5c206a

Browse files
authored
Merge pull request #40477 from windsonsea/nodesy
[zh] sync security-checklist.md and api-server-bypass-risks.md
2 parents b1bd85a + 1a39d9e commit d5c206a

File tree

2 files changed

+57
-19
lines changed

2 files changed

+57
-19
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ As part of this role, the API server has several key built-in security controls,
2626
audit logging and {{< glossary_tooltip text="admission controllers" term_id="admission-controller" >}}.
2727
However, there are ways to modify the configuration
2828
or content of the cluster that bypass these controls.
29-
-->
30-
作为此角色的一部分,API 服务器有几个关键的内置安全控制
29+
-->
30+
API 服务器作为交互的主要入口,还提供了几种关键的内置安全控制
3131
例如审计日志和{{< glossary_tooltip text="准入控制器" term_id="admission-controller" >}}。
32-
但是,有一些方法可以绕过这些安全控制从而修改集群的配置或内容
32+
但有一些方式可以绕过这些安全控制从而修改集群的配置或内容
3333

3434
<!--
3535
This page describes the ways in which the security controls built into the

content/zh-cn/docs/concepts/security/security-checklist.md

Lines changed: 54 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,8 @@ AppArmor 配置文件是通过注解的方式,以容器为粒度强制执行
353353
AppArmor is only available on Linux nodes, and enabled in
354354
[some Linux distributions](https://gitlab.com/apparmor/apparmor/-/wikis/home#distributions-and-ports).
355355
-->
356-
AppArmor 仅在 Linux 节点上可用,在[一些 Linux 发行版](https://gitlab.com/apparmor/apparmor/-/wikis/home#distributions-and-ports)中已启用。
356+
AppArmor 仅在 Linux 节点上可用,
357+
[一些 Linux 发行版](https://gitlab.com/apparmor/apparmor/-/wikis/home#distributions-and-ports)中已启用。
357358
{{< /note >}}
358359

359360
#### SELinux
@@ -374,9 +375,47 @@ SELinux 标签可以[通过 `securityContext` 节](/zh-cn/docs/tasks/configure-p
374375
SELinux is only available on Linux nodes, and enabled in
375376
[some Linux distributions](https://en.wikipedia.org/wiki/Security-Enhanced_Linux#Implementations).
376377
-->
377-
SELinux 仅在 Linux 节点上可用,在[一些 Linux 发行版](https://en.wikipedia.org/wiki/Security-Enhanced_Linux#Implementations)中已启用。
378+
SELinux 仅在 Linux 节点上可用,
379+
[一些 Linux 发行版](https://en.wikipedia.org/wiki/Security-Enhanced_Linux#Implementations)中已启用。
378380
{{< /note >}}
379381

382+
<!--
383+
## Logs and auditing
384+
385+
- [ ] Audit logs, if enabled, are protected from general access.
386+
- [ ] The `/logs` API is disabled (you are running kube-apiserver with
387+
`--enable-logs-handler=false`).
388+
-->
389+
## 日志和审计 {#logs-and-auditing}
390+
391+
- [ ] 审计日志(如果启用)将受到保护以防止常规访问。
392+
- [ ] `/logs` API 被禁用(你所运行的 kube-apiserver 设置了 `--enable-logs-handler=false`)。
393+
394+
<!--
395+
Kubernetes includes a `/logs` API endpoint, enabled by default,
396+
that lets users request the contents of the API server's `/var/log` directory over HTTP. Accessing
397+
that endpoint requires authentication.
398+
-->
399+
Kubernetes 包含一个 `/logs` API 端点,默认启用。
400+
这个端点允许用户通过 HTTP 来请求 API 服务器的 `/var/log` 目录的内容。
401+
访问此端点需要身份验证。
402+
403+
<!--
404+
Allowing broad access to Kubernetes logs can make security information
405+
available to a potential attacker.
406+
407+
As a good practice, set up a separate means to collect and aggregate
408+
control plane logs, and do not use the `/logs` API endpoint.
409+
Alternatively, if you run your control plane with the `/logs` API endpoint
410+
and limit the content of `/var/log` (within the host or container where the API server is running) to
411+
Kubernetes API server logs only.
412+
-->
413+
允许大范围访问 Kubernetes 日志可能会令安全信息被潜在的攻击者利用。
414+
415+
一个好的做法是设置一个单独的方式来收集和聚合控制平面日志,
416+
并且不要使用 `/logs` API 端点。另一个使用场景是你运行控制平面时启用了 `/logs` API 端点并
417+
(在运行 API 服务器的主机或容器内)将 `/var/log` 的内容限制为仅保存 Kubernetes API 服务器日志。
418+
380419
<!--
381420
## Pod placement
382421
@@ -414,8 +453,8 @@ admission controller.
414453
-->
415454
[节点选择器(Node Selector)](/zh-cn/docs/concepts/scheduling-eviction/assign-pod-node/)
416455
: 作为 Pod 规约的一部分来设置的键值对,指定 Pod 可部署到哪些节点。
417-
通过 [PodNodeSelector](/zh-cn/docs/reference/access-authn-authz/admission-controllers/#podnodeselector)
418-
准入控制器可以在名字空间和集群级别强制实施节点选择。
456+
通过 [PodNodeSelector](/zh-cn/docs/reference/access-authn-authz/admission-controllers/#podnodeselector)
457+
准入控制器可以在名字空间和集群级别强制实施节点选择。
419458

420459
<!--
421460
[PodTolerationRestriction](/docs/reference/access-authn-authz/admission-controllers/#podtolerationrestriction)
@@ -427,8 +466,8 @@ tolerations.
427466
-->
428467
[PodTolerationRestriction](/zh-cn/docs/reference/access-authn-authz/admission-controllers/#podtolerationrestriction)
429468
: [容忍度](/zh-cn/docs/concepts/scheduling-eviction/taint-and-toleration/)准入控制器,
430-
允许管理员设置在名字空间内允许使用的容忍度。
431-
名字空间中的 Pod 只能使用名字空间对象的注解键上所指定的容忍度,这些键提供默认和允许的容忍度集合。
469+
允许管理员设置在名字空间内允许使用的容忍度。
470+
名字空间中的 Pod 只能使用名字空间对象的注解键上所指定的容忍度,这些键提供默认和允许的容忍度集合。
432471

433472
<!--
434473
[RuntimeClass](/docs/concepts/containers/runtime-class/)
@@ -439,7 +478,7 @@ overhead.
439478
-->
440479
[RuntimeClass](/zh-cn/docs/concepts/containers/runtime-class/)
441480
: RuntimeClass 是一个用于选择容器运行时配置的特性,容器运行时配置用于运行 Pod 中的容器,
442-
并以性能开销为代价提供或多或少的主机隔离能力。
481+
并以性能开销为代价提供或多或少的主机隔离能力。
443482

444483
## Secrets {#secrets}
445484

@@ -482,7 +521,7 @@ permission mechanism on files.
482521
需要 Secret 的 Pod 应该通过卷自动挂载这些信息,
483522
最好使用 [`emptyDir.medium` 选项](/zh-cn/docs/concepts/storage/volumes/#emptydir)存储在内存中。
484523
该机制还可以用于从第三方存储中注入 Secret 作为卷,如 [Secret Store CSI 驱动](https://secrets-store-csi-driver.sigs.k8s.io/)
485-
与通过 RBAC 来允许 Pod 服务帐户访问 Secret 相比,应该优先使用上述机制。这种机制允许将 Secret 作为环境变量或文件添加到 Pod 中。
524+
与通过 RBAC 来允许 Pod 服务账号访问 Secret 相比,应该优先使用上述机制。这种机制允许将 Secret 作为环境变量或文件添加到 Pod 中。
486525
请注意,与带访问权限控制的文件相比,由于日志的崩溃转储,以及 Linux 的环境变量的非机密性,环境变量方法可能更容易发生泄漏。
487526

488527
<!--
@@ -493,13 +532,11 @@ or specifically for a pod. For Kubernetes v1.22 and above, use
493532
[Bound Service Accounts](/docs/reference/access-authn-authz/service-accounts-admin/#bound-service-account-token-volume)
494533
for time-bound service account credentials.
495534
-->
496-
不应该将服务账号令牌挂载到不需要它们的 Pod 中。
497-
这可以通过在服务帐号内将
535+
不应该将服务账号令牌挂载到不需要它们的 Pod 中。这可以通过在服务账号内将
498536
[`automountServiceAccountToken`](/zh-cn/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server)
499-
设置为 `false` 来完成整个名字空间范围的配置,
500-
或者也可以单独在 Pod 层面定制。
537+
设置为 `false` 来完成整个名字空间范围的配置,或者也可以单独在 Pod 层面定制。
501538
对于 Kubernetes v1.22 及更高版本,
502-
请使用[绑定服务账号](/zh-cn/docs/reference/access-authn-authz/service-accounts-admin/#bound-service-account-token-volume)作为有时间限制的服务帐号凭证
539+
请使用[绑定服务账号](/zh-cn/docs/reference/access-authn-authz/service-accounts-admin/#bound-service-account-token-volume)作为有时间限制的服务账号凭证
503540

504541
<!--
505542
## Images
@@ -696,7 +733,8 @@ availability state and recommended to improve your security posture:
696733
-->
697734
[`DenyServiceExternalIPs`](/zh-cn/docs/reference/access-authn-authz/admission-controllers/#denyserviceexternalips)
698735
: 拒绝使用 `Service.spec.externalIPs` 字段,已有的 Service 不受影响,新增或者变更时不允许使用。
699-
这是 [CVE-2020-8554:中间人使用 LoadBalancer 或 ExternalIP](https://github.com/kubernetes/kubernetes/issues/97076) 的缓解措施。
736+
这是 [CVE-2020-8554:中间人使用 LoadBalancer 或 ExternalIP](https://github.com/kubernetes/kubernetes/issues/97076)
737+
的缓解措施。
700738

701739
<!--
702740
[`NodeRestriction`](/docs/reference/access-authn-authz/admission-controllers/#noderestriction)
@@ -708,8 +746,8 @@ placement to the controlled node.
708746
-->
709747
[`NodeRestriction`](/zh-cn/docs/reference/access-authn-authz/admission-controllers/#noderestriction)
710748
: 将 kubelet 的权限限制为只能修改其拥有的 Pod API 资源或代表其自身的节点 API 资源。
711-
此插件还可以防止 kubelet 使用 `node-restriction.kubernetes.io/` 注解,
712-
攻击者可以使用该注解来访问 kubelet 的凭证,从而影响所控制的节点上的 Pod 布局。
749+
此插件还可以防止 kubelet 使用 `node-restriction.kubernetes.io/` 注解,
750+
攻击者可以使用该注解来访问 kubelet 的凭证,从而影响所控制的节点上的 Pod 布局。
713751

714752
<!--
715753
The third group includes plugins that are not enabled by default but could be

0 commit comments

Comments
 (0)