將 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)