将 PodSecurityPolicies 映射到 Pod 安全标准
下表列举了 PodSecurityPolicy
对象上的配置参数,这些字段是否会修改和/或验证 Pod,以及配置值如何映射到 Pod 安全标准。
对于每个适用的参数,列出了 基线 和 受限 配置文件的允许值。超出这些配置文件允许值的任何内容都将归入 特权 配置文件。"无意见" 表示所有 Pod 安全标准下都允许所有值。
有关分步迁移指南,请参阅 从 PodSecurityPolicy 迁移到内置的 PodSecurity Admission Controller。
PodSecurityPolicy 规范
此表中列举的字段是 PodSecurityPolicySpec
的一部分,其在 .spec
字段路径下指定。
PodSecurityPolicySpec | 类型 | 等效的 Pod 安全标准 |
---|---|---|
privileged | 验证中 | 基线和受限:false / 未定义 / nil |
defaultAddCapabilities | 修改和验证中 | 要求与下面的 allowedCapabilities 匹配。 |
allowedCapabilities | 验证中 | 基线:以下子集
受限:空 / 未定义 / nil **或** 仅包含 |
requiredDropCapabilities | 修改和验证中 | 基线:无意见 受限:必须包含 |
volumes | 验证中 | 基线:除了以下之外的任何卷
受限:以下子集
|
hostNetwork | 验证中 | 基线和受限:false / 未定义 / nil |
hostPorts | 验证中 | 基线和受限:未定义 / nil / 空 |
hostPID | 验证中 | 基线和受限:false / 未定义 / nil |
hostIPC | 验证中 | 基线和受限:false / 未定义 / nil |
seLinux | 修改和验证中 | 基线和受限:
|
runAsUser | 修改和验证中 | 基线:任意值 受限: |
runAsGroup | 修改中 (MustRunAs) 和验证中 | 无意见 |
supplementalGroups | 修改和验证中 | 无意见 |
fsGroup | 修改和验证中 | 无意见 |
readOnlyRootFilesystem | 修改和验证中 | 无意见 |
defaultAllowPrivilegeEscalation | 修改中 | 无意见(不验证) |
allowPrivilegeEscalation | 修改和验证中 | 仅当设置为 基线:无意见 受限: |
allowedHostPaths | 验证中 | 无意见(volumes 优先) |
allowedFlexVolumes | 验证中 | 无意见(volumes 优先) |
allowedCSIDrivers | 验证中 | 无意见(volumes 优先) |
allowedUnsafeSysctls | 验证中 | 基线和受限:未定义 / nil / 空 |
forbiddenSysctls | 验证中 | 无意见 |
allowedProcMountTypes (Alpha 特性) | 验证中 | 基线和受限:["Default"] **或** 未定义 / nil / 空 |
runtimeClass .defaultRuntimeClassName | 修改中 | 无意见 |
runtimeClass .allowedRuntimeClassNames | 验证中 | 无意见 |
PodSecurityPolicy 注解
此表中列举的 注解 可以在 PodSecurityPolicy 对象的 .metadata.annotations
下指定。
PSP 注解 | 类型 | 等效的 Pod 安全标准 |
---|---|---|
seccomp.security.alpha.kubernetes.io /defaultProfileName | 修改中 | 无意见 |
seccomp.security.alpha.kubernetes.io /allowedProfileNames | 验证中 | 基线: 受限:
|
apparmor.security.beta.kubernetes.io /defaultProfileName | 修改中 | 无意见 |
apparmor.security.beta.kubernetes.io /allowedProfileNames | 验证中 | 基线: 受限:
|
上次修改于 2024 年 7 月 23 日太平洋标准时间下午 12:19:PSS: 为 selinux 类型允许列表添加 container_engine_t (06aff012a2)