檢視次數:
設定檔適用性:等級 2
在 pod 定義中啟用 RuntimeDefault seccomp 配置檔。
Seccomp(安全計算模式)用於限制應用程式可以進行的系統呼叫集合,讓叢集管理員能更好地控制在叢集中運行的工作負載的安全性。Kubernetes 出於歷史原因,預設禁用 seccomp 配置檔。應啟用它以確保工作負載在容器內的可用操作受到限制。
注意
注意
預設情況下,seccomp 配置檔案設置為 unconfined,這意味著未啟動任何 seccomp 配置檔案。

影響

如果 RuntimeDefault seccomp 配置檔對您來說過於限制,您將需要建立/管理您自己的 Localhost seccomp 配置檔。

稽核

檢查叢集中所有命名空間的 Pod 定義輸出,使用以下命令。
kubectl get pods --all-namespaces -o json | jq -r '.items[] | select(.metadata.annotations."seccomp.security.alpha.kubernetes.io/pod" == "runtime/default" or .spec.securityContext.seccompProfile.type == "RuntimeDefault") | {namespace: .metadata.namespace, name: .metadata.name, seccompProfile: .spec.securityContext.seccompProfile.type}'

補救

使用安全上下文在您的 Pod 定義中啟用 RuntimeDefault seccomp 配置文件。範例如下:
{ "namespace": "kube-system", "name": "metrics-server-v0.7.0-dbcc8ddf6-gz7d4", "seccompProfile": "RuntimeDefault" }