説明
Linux の seccomp プロファイルはコンテナープロセスが使用できるシステムコールを制限します。Unconfined はこの制限を無効にします。プロファイルを省略した場合は kubelet とランタイムで適用されるデフォルトを確認してください。
想定される影響
制限が緩ければ不要なシステムコールを使用でき、厳しすぎると通常の処理が失敗する場合があります。
対処方法
対応する Terraform プロバイダーで security_context.seccomp_profile.type に RuntimeDefault を指定します。Localhost を使う場合は、localhost_profile に指定した確認済みのファイルを、Pod の配置先となるすべてのノードに配置してください。コンテナー側の上書きと特権モードも確認します。特権コンテナーには seccomp の制限が適用されません。
例
両方の例は同じ Pod 単位のブロックを使い、Unconfined から RuntimeDefault に変更しています。保守されている Linux イメージで必要な処理と拒否ログを確認し、非 root 実行、最小限のケーパビリティ、セキュリティ更新も維持してください。
変更前
hcl
resource "kubernetes_pod" "pod" {
metadata {
name = "terraform-example"
}
spec {
security_context {
seccomp_profile {
type = "Unconfined"
}
}
container {
image = "nginx:1.7.9"
name = "example"
}
}
}
変更後
hcl
resource "kubernetes_pod" "pod" {
metadata {
name = "terraform-example"
}
spec {
security_context {
seccomp_profile {
type = "RuntimeDefault"
}
}
container {
image = "nginx:1.7.9"
name = "example"
}
}
}