@@ -353,7 +353,8 @@ AppArmor 配置文件是通过注解的方式,以容器为粒度强制执行
353
353
AppArmor is only available on Linux nodes, and enabled in
354
354
[some Linux distributions](https://gitlab.com/apparmor/apparmor/-/wikis/home#distributions-and-ports).
355
355
-->
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 ) 中已启用。
357
358
{{< /note >}}
358
359
359
360
#### SELinux
@@ -374,9 +375,47 @@ SELinux 标签可以[通过 `securityContext` 节](/zh-cn/docs/tasks/configure-p
374
375
SELinux is only available on Linux nodes, and enabled in
375
376
[some Linux distributions](https://en.wikipedia.org/wiki/Security-Enhanced_Linux#Implementations).
376
377
-->
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 ) 中已启用。
378
380
{{< /note >}}
379
381
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
+
380
419
<!--
381
420
## Pod placement
382
421
@@ -414,8 +453,8 @@ admission controller.
414
453
-->
415
454
[ 节点选择器(Node Selector)] ( /zh-cn/docs/concepts/scheduling-eviction/assign-pod-node/ )
416
455
: 作为 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
+ 准入控制器可以在名字空间和集群级别强制实施节点选择。
419
458
420
459
<!--
421
460
[PodTolerationRestriction](/docs/reference/access-authn-authz/admission-controllers/#podtolerationrestriction)
@@ -427,8 +466,8 @@ tolerations.
427
466
-->
428
467
[ PodTolerationRestriction] ( /zh-cn/docs/reference/access-authn-authz/admission-controllers/#podtolerationrestriction )
429
468
: [ 容忍度] ( /zh-cn/docs/concepts/scheduling-eviction/taint-and-toleration/ ) 准入控制器,
430
- 允许管理员设置在名字空间内允许使用的容忍度。
431
- 名字空间中的 Pod 只能使用名字空间对象的注解键上所指定的容忍度,这些键提供默认和允许的容忍度集合。
469
+ 允许管理员设置在名字空间内允许使用的容忍度。
470
+ 名字空间中的 Pod 只能使用名字空间对象的注解键上所指定的容忍度,这些键提供默认和允许的容忍度集合。
432
471
433
472
<!--
434
473
[RuntimeClass](/docs/concepts/containers/runtime-class/)
@@ -439,7 +478,7 @@ overhead.
439
478
-->
440
479
[ RuntimeClass] ( /zh-cn/docs/concepts/containers/runtime-class/ )
441
480
: RuntimeClass 是一个用于选择容器运行时配置的特性,容器运行时配置用于运行 Pod 中的容器,
442
- 并以性能开销为代价提供或多或少的主机隔离能力。
481
+ 并以性能开销为代价提供或多或少的主机隔离能力。
443
482
444
483
## Secrets {#secrets}
445
484
@@ -482,7 +521,7 @@ permission mechanism on files.
482
521
需要 Secret 的 Pod 应该通过卷自动挂载这些信息,
483
522
最好使用 [ ` emptyDir.medium ` 选项] ( /zh-cn/docs/concepts/storage/volumes/#emptydir ) 存储在内存中。
484
523
该机制还可以用于从第三方存储中注入 Secret 作为卷,如 [ Secret Store CSI 驱动] ( https://secrets-store-csi-driver.sigs.k8s.io/ ) 。
485
- 与通过 RBAC 来允许 Pod 服务帐户访问 Secret 相比,应该优先使用上述机制。这种机制允许将 Secret 作为环境变量或文件添加到 Pod 中。
524
+ 与通过 RBAC 来允许 Pod 服务账号访问 Secret 相比,应该优先使用上述机制。这种机制允许将 Secret 作为环境变量或文件添加到 Pod 中。
486
525
请注意,与带访问权限控制的文件相比,由于日志的崩溃转储,以及 Linux 的环境变量的非机密性,环境变量方法可能更容易发生泄漏。
487
526
488
527
<!--
@@ -493,13 +532,11 @@ or specifically for a pod. For Kubernetes v1.22 and above, use
493
532
[Bound Service Accounts](/docs/reference/access-authn-authz/service-accounts-admin/#bound-service-account-token-volume)
494
533
for time-bound service account credentials.
495
534
-->
496
- 不应该将服务账号令牌挂载到不需要它们的 Pod 中。
497
- 这可以通过在服务帐号内将
535
+ 不应该将服务账号令牌挂载到不需要它们的 Pod 中。这可以通过在服务账号内将
498
536
[ ` 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 层面定制。
501
538
对于 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 ) 作为有时间限制的服务账号凭证 。
503
540
504
541
<!--
505
542
## Images
@@ -696,7 +733,8 @@ availability state and recommended to improve your security posture:
696
733
-->
697
734
[ ` DenyServiceExternalIPs ` ] ( /zh-cn/docs/reference/access-authn-authz/admission-controllers/#denyserviceexternalips )
698
735
: 拒绝使用 ` 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
+ 的缓解措施。
700
738
701
739
<!--
702
740
[`NodeRestriction`](/docs/reference/access-authn-authz/admission-controllers/#noderestriction)
@@ -708,8 +746,8 @@ placement to the controlled node.
708
746
-->
709
747
[ ` NodeRestriction ` ] ( /zh-cn/docs/reference/access-authn-authz/admission-controllers/#noderestriction )
710
748
: 将 kubelet 的权限限制为只能修改其拥有的 Pod API 资源或代表其自身的节点 API 资源。
711
- 此插件还可以防止 kubelet 使用 ` node-restriction.kubernetes.io/ ` 注解,
712
- 攻击者可以使用该注解来访问 kubelet 的凭证,从而影响所控制的节点上的 Pod 布局。
749
+ 此插件还可以防止 kubelet 使用 ` node-restriction.kubernetes.io/ ` 注解,
750
+ 攻击者可以使用该注解来访问 kubelet 的凭证,从而影响所控制的节点上的 Pod 布局。
713
751
714
752
<!--
715
753
The third group includes plugins that are not enabled by default but could be
0 commit comments