@@ -398,7 +398,7 @@ metadata:
398
398
spec:
399
399
containers:
400
400
- name: hello
401
- image: busybox
401
+ image: busybox:1.28
402
402
command: [ "sh", "-c", "echo 'Hello AppArmor!' && sleep 1h" ]
403
403
EOF
404
404
pod/hello-apparmor-2 created
@@ -510,10 +510,10 @@ Pod 在具有所需配置文件的节点上运行。
510
510
{{< note >}}
511
511
<!--
512
512
PodSecurityPolicy is deprecated in Kubernetes v1.21, and will be removed in v1.25.
513
- See [PodSecurityPolicy documentation ](/docs/concepts/policy /pod-security-policy/) for more information.
513
+ See [PodSecurityPolicy](/docs/concepts/security /pod-security-policy/) documentation for more information.
514
514
-->
515
515
PodSecurityPolicy 在 Kubernetes v1.21 版本中已被废弃,将在 v1.25 版本移除。
516
- 查看 [ PodSecurityPolicy 文档 ] ( /zh/docs/concepts/policy /pod-security-policy/ ) 获取更多信息 。
516
+ 查看 [ PodSecurityPolicy] ( /zh/docs/concepts/security /pod-security-policy/ ) 文档获取更多信息 。
517
517
{{< /note >}}
518
518
519
519
<!--
@@ -559,47 +559,21 @@ specification.
559
559
560
560
<!--
561
561
When disabled, any Pod that includes an AppArmor profile will fail validation with a "Forbidden"
562
- error. Note that by default docker always enables the "docker-default" profile on non-privileged
563
- pods (if the AppArmor kernel module is enabled), and will continue to do so even if the feature-gate
564
- is disabled. The option to disable AppArmor will be removed when AppArmor graduates to general
565
- availability (GA).
562
+ error.
566
563
-->
567
564
禁用时,任何包含 AppArmor 配置文件的 Pod 都将导致验证失败,且返回 “Forbidden” 错误。
568
- 注意,默认情况下,docker 总是在非特权 Pod 上启用 “docker-default” 配置文件(如果 AppArmor 内核模块已启用),
569
- 并且即使特性门控已禁用,也将继续启用该配置文件。
570
- 当 AppArmor 升级到正式发布(GA)阶段时,禁用 Apparmor 的选项将被删除。
571
565
572
- <!-- ### Upgrading to Kubernetes v1.4 with AppArmor -->
573
- ### 使用 AppArmor 升级到 Kubernetes v1.4
574
-
575
- <!--
576
- No action is required with respect to AppArmor to upgrade your cluster to v1.4. However, if any
577
- existing pods had an AppArmor annotation, they will not go through validation (or PodSecurityPolicy
578
- admission). If permissive profiles are loaded on the nodes, a malicious user could pre-apply a
579
- permissive profile to escalate the pod privileges above the docker-default. If this is a concern, it
580
- is recommended to scrub the cluster of any pods containing an annotation with
581
- `apparmor.security.beta.kubernetes.io`.
566
+ {{<note >}}
567
+ <!--
568
+ Even if the Kubernetes feature is disabled, runtimes may still enforce the default profile. The
569
+ option to disable the AppArmor feature will be removed when AppArmor graduates to general
570
+ availability (GA).
582
571
-->
583
- 不需要对 AppArmor 执行任何操作即可将集群升级到 v1.4。但是,
584
- 如果任何现有的 Pod 有一个 AppArmor 注解,
585
- 它们将无法通过合法性检查(或 PodSecurityPolicy 准入控制)。
586
- 如果节点上加载了宽松的配置文件,恶意用户可以预先应用宽松的配置文件,
587
- 将 Pod 权限提升到 docker-default 权限之上。
588
- 如果存在这个问题,建议清除集群中包含 ` apparmor.security.beta.kubernetes.io ` 注解的所有 Pod。
572
+ 即使此 Kubernetes 特性被禁用,运行时仍可能强制执行默认配置文件。
573
+ 当 AppArmor 升级为正式版 (GA) 时,禁用 AppArmor 功能的选项将被删除。
589
574
590
- <!-- ### Upgrade path to General Availability -->
591
- ### 升级到正式发布的途径 {#upgrade-path-to-general-availability}
575
+ {{</note >}}
592
576
593
- <!--
594
- When AppArmor is ready to be graduated to general availability (GA), the options currently specified
595
- through annotations will be converted to fields. Supporting all the upgrade and downgrade paths
596
- through the transition is very nuanced, and will be explained in detail when the transition
597
- occurs. We will commit to supporting both fields and annotations for at least 2 releases, and will
598
- explicitly reject the annotations for at least 2 releases after that.
599
- -->
600
- 当 Apparmor 准备升级到正式发布(GA)状态时,当前通过注解指定的选项将转换为字段。
601
- 通过转换支持所有升级和降级路径是非常微妙的,并将在转换发生时详细解释。
602
- 我们将承诺在至少两个发行版本中同时支持字段和注解,并在之后的至少两个版本中显式拒绝注解。
603
577
604
578
<!-- ## Authoring Profiles -->
605
579
## 编写配置文件 {#authoring-profiles}
@@ -623,14 +597,6 @@ tools to help with that:
623
597
* [ bane] ( https://github.com/jfrazelle/bane )
624
598
是一个用于 Docker的 AppArmor 配置文件生成器,它使用一种简化的画像语言(profile language)
625
599
626
- <!--
627
- It is recommended to run your application through Docker on a development workstation to generate
628
- the profiles, but there is nothing preventing running the tools on the Kubernetes node where your
629
- Pod is running.
630
- -->
631
- 建议在开发工作站上通过 Docker 运行应用程序以生成配置文件,
632
- 不过在运行 Pod 的 Kubernetes 节点上运行这些工具也是可以的。
633
-
634
600
<!--
635
601
To debug problems with AppArmor, you can check the system logs to see what, specifically, was
636
602
denied. AppArmor logs verbose messages to `dmesg`, and errors can usually be found in the system
@@ -669,19 +635,17 @@ AppArmor 将详细消息记录到 `dmesg`,
669
635
- `runtime/default`: Refers to the default runtime profile.
670
636
- Equivalent to not specifying a profile (without a PodSecurityPolicy default), except it still
671
637
requires AppArmor to be enabled.
672
- - For Docker, this resolves to the
673
- [`docker-default`](https://docs.docker.com/engine/security/apparmor/) profile for non-privileged
674
- containers, and unconfined (no profile) for privileged containers.
638
+ - In practice, many container runtimes use the same OCI default profile, defined here:
639
+ https://github.com/containers/common/blob/main/pkg/apparmor/apparmor_linux_template.go
675
640
- `localhost/<profile_name>`: Refers to a profile loaded on the node (localhost) by name.
676
641
- The possible profile names are detailed in the
677
642
[core policy reference](https://gitlab.com/apparmor/apparmor/wikis/AppArmor_Core_Policy_Reference#profile-names-and-attachment-specifications).
678
643
- `unconfined`: This effectively disables AppArmor on the container.
679
644
-->
680
645
- ` runtime/default ` : 指默认运行时配置文件。
681
646
- 等同于不指定配置文件(没有 PodSecurityPolicy 默认值),只是它仍然需要启用 AppArmor。
682
- - 对于 Docker,针对非特权容器时解析为
683
- [ ` Docker default ` ] ( https://docs.docker.com/engine/security/apparmor/ ) 配置文件,
684
- 针对特权容器时解析为 unconfined(无配置文件)。
647
+ - 实际上,许多容器运行时使用相同的 OCI 默认配置文件,在此处定义:
648
+ https://github.com/containers/common/blob/main/pkg/apparmor/apparmor_linux_template.go
685
649
- ` localhost/<profile_name> ` : 按名称引用加载到节点(localhost)上的配置文件。
686
650
- 可能的配置文件名在[ 核心策略参考] ( https://gitlab.com/apparmor/apparmor/wikis/AppArmor_Core_Policy_Reference#profile-names-and-attachment-specifications ) 。
687
651
- ` unconfined ` : 这相当于为容器禁用 AppArmor。
0 commit comments