Skip to content

Commit 899586e

Browse files
authored
Merge pull request #39344 from Zhuzhenghao/admission-controllers
[zh] Resync admission-controllers.md
2 parents 948538f + 723b276 commit 899586e

File tree

1 file changed

+56
-27
lines changed

1 file changed

+56
-27
lines changed

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

Lines changed: 56 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ the `admissionregistration.k8s.io/v1alpha1` API.
194194
但只有启用 `ValidatingAdmissionPolicy`
195195
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/) ****
196196
`admissionregistration.k8s.io/v1alpha1` API 时才会激活。
197-
{{< note >}}
197+
{{< /note >}}
198198

199199
<!--
200200
## What does each admission controller do?
@@ -647,21 +647,21 @@ An example request body:
647647

648648
```json
649649
{
650-
"apiVersion":"imagepolicy.k8s.io/v1alpha1",
651-
"kind":"ImageReview",
652-
"spec":{
653-
"containers":[
650+
"apiVersion": "imagepolicy.k8s.io/v1alpha1",
651+
"kind": "ImageReview",
652+
"spec": {
653+
"containers": [
654654
{
655-
"image":"myrepo/myimage:v1"
655+
"image": "myrepo/myimage:v1"
656656
},
657657
{
658-
"image":"myrepo/myimage@sha256:beb6bd6a68f114c1dc2ea4b28db81bdf91de202a9014972bec5e4d9171d90ed"
658+
"image": "myrepo/myimage@sha256:beb6bd6a68f114c1dc2ea4b28db81bdf91de202a9014972bec5e4d9171d90ed"
659659
}
660660
],
661-
"annotations":{
661+
"annotations": {
662662
"mycluster.image-policy.k8s.io/ticket-1234": "break-glass"
663663
},
664-
"namespace":"mynamespace"
664+
"namespace": "mynamespace"
665665
}
666666
}
667667
```
@@ -1263,30 +1263,59 @@ for more information.
12631263

12641264
### SecurityContextDeny {#securitycontextdeny}
12651265

1266+
{{< feature-state for_k8s_version="v1.0" state="alpha" >}}
1267+
1268+
{{< caution >}}
1269+
<!--
1270+
This admission controller plugin is **outdated** and **incomplete**, it may be
1271+
unusable or not do what you would expect. It was originally designed to prevent
1272+
the use of some, but not all, security-sensitive fields. Indeed, fields like
1273+
`privileged`, were not filtered at creation and the plugin was not updated with
1274+
the most recent fields, and new APIs like the `ephemeralContainers` field for a
1275+
Pod.
1276+
-->
1277+
这个准入控制器插件是**过时的**且**不完整的**,它可能无法使用或无法达到你的预期。
1278+
它最初旨在防止使用某些(但不是全部)安全敏感字段。
1279+
事实上,像 `privileged` 这样的字段在创建时并没有被过滤,
1280+
而且该插件没有根据最新的字段和新的 API(例如 Pod 的 `ephemeralContainers` 字段)来更新。
1281+
1282+
<!--
1283+
The [Pod Security Admission](/docs/concepts/security/pod-security-admission/)
1284+
plugin enforcing the [Pod Security Standards](/docs/concepts/security/pod-security-standards/)
1285+
`Restricted` profile captures what this plugin was trying to achieve in a better
1286+
and up-to-date way.
1287+
-->
1288+
采用 [Pod 安全性标准](/zh-cn/docs/concepts/security/pod-security-standards/)中的 `Restricted`
1289+
方案的 [Pod 安全性准入](/zh-cn/docs/concepts/security/pod-security-admission/)插件,
1290+
能以更好和最新的方式来表述此插件所要实现的目标。
1291+
{{< /caution >}}
1292+
12661293
<!--
1267-
This admission controller will deny any Pod that attempts to set certain escalating
1268-
[SecurityContext](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#securitycontext-v1-core)
1269-
fields, as shown in the
1270-
[Configure a Security Context for a Pod or Container](/docs/tasks/configure-pod-container/security-context/)
1271-
task.
1272-
If you don't use [Pod Security admission](/docs/concepts/security/pod-security-admission/),
1273-
[PodSecurityPolicies](/docs/concepts/security/pod-security-policy/), nor any external enforcement mechanism,
1274-
then you could use this admission controller to restrict the set of values a security context can take.
1294+
This admission controller will deny any Pod that attempts to set the following
1295+
[SecurityContext](/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context)
1296+
fields:
12751297
-->
1276-
此准入控制器将拒绝任何试图设置特定提升
1298+
此准入控制器将拒绝任何尝试设置以下
12771299
[SecurityContext](/zh-cn/docs/tasks/configure-pod-container/security-context/)
1278-
中某些字段的 Pod,正如任务[为 Pod 或 Container 配置安全上下文](/zh-cn/docs/tasks/configure-pod-container/security-context/)
1279-
中所展示的那样。如果集群没有使用
1280-
[Pod 安全性准入](/zh-cn/docs/concepts/security/pod-security-admission/)、
1281-
[PodSecurityPolicy](/zh-cn/docs/concepts/security/pod-security-policy/),
1282-
也没有任何外部强制机制,那么你可以使用此准入控制器来限制安全上下文所能获取的值集。
1300+
字段的 Pod:
1301+
1302+
- `.spec.securityContext.supplementalGroups`
1303+
- `.spec.securityContext.seLinuxOptions`
1304+
- `.spec.securityContext.runAsUser`
1305+
- `.spec.securityContext.fsGroup`
1306+
- `.spec.(init)Containers[*].securityContext.seLinuxOptions`
1307+
- `.spec.(init)Containers[*].securityContext.runAsUser`
12831308

12841309
<!--
1285-
See [Pod Security Standards](/docs/concepts/security/pod-security-standards/) for more context on restricting
1286-
pod privileges.
1310+
For more historical context on this plugin, see
1311+
[The birth of PodSecurityPolicy](/blog/2022/08/23/podsecuritypolicy-the-historical-context/#the-birth-of-podsecuritypolicy)
1312+
from the Kubernetes blog article about PodSecurityPolicy and its removal. The
1313+
article details the PodSecurityPolicy historical context and the birth of the
1314+
`securityContext` field for Pods.
12871315
-->
1288-
有关限制 Pod 权限的更多内容,请参阅
1289-
[Pod 安全标准](/zh-cn/docs/concepts/security/pod-security-standards/)。
1316+
有关此插件的更多历史背景,请参阅 Kubernetes 博客中这篇有关 PodSecurityPolicy 及其移除的文章:
1317+
[The birth of PodSecurityPolicy](/blog/2022/08/23/podsecuritypolicy-the-historical-context/#the-birth-of-podsecuritypolicy)。
1318+
这篇文章详细地介绍了 PodSecurityPolicy 的历史背景以及 Pod 的 `securityContext` 字段的诞生。
12901319

12911320
### ServiceAccount {#serviceaccount}
12921321

0 commit comments

Comments
 (0)