From df6995b6232e40356bae6f9efc96dbcb5f3c8725 Mon Sep 17 00:00:00 2001 From: Simar Date: Tue, 15 Oct 2024 19:25:07 -0600 Subject: [PATCH] feat(checks): Add a deprecation message for PSP --- checks/kubernetes/README.md | 4 +++- .../cisbenchmarks/apiserver/security_context_deny_plugin.rego | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/checks/kubernetes/README.md b/checks/kubernetes/README.md index 28dff4fe..2f0459f0 100644 --- a/checks/kubernetes/README.md +++ b/checks/kubernetes/README.md @@ -33,7 +33,9 @@ conftest test denied.yaml --policy myPolicy/ --namespace builtin.kubernetes.KSV0 This GitHub repository has controls that cover both [PodSecurityPolicy](https://kubernetes.io/docs/concepts/policy/pod-security-policy/) (PSP) and the Kubernetes [Pod Security Standards](https://kubernetes.io/docs/concepts/security/pod-security-standards/) (PSS), plus additional best practices. ## PSS and PSP -The Kubernetes Pod Security Standards (PSS) are the official standard for security best practices for pods. These standards overlaps with the checks that PodSecurityPolicies can enforce. +The following info is only a reference for historical purposes as PSP has been [deprecated](https://kubernetes.io/blog/2021/04/06/podsecuritypolicy-deprecation-past-present-and-future/). + +The Kubernetes Pod Security Standards (PSS) are the official standard for security best practices for pods. These standards overlaps with the checks that PodSecurityPolicies (now deprecated) can enforce. PSS has 14 controls that are grouped into three standards: Baseline, Restricted and Privileged. Appshield uses Baseline and Restricted; the Privileged standard specifically allows privileged execution. We named the controls in this repository under the PSS controls because they are more up-to-date and have better coverage than PSP. The below table maps PSS controls to PSP controls: diff --git a/checks/kubernetes/cisbenchmarks/apiserver/security_context_deny_plugin.rego b/checks/kubernetes/cisbenchmarks/apiserver/security_context_deny_plugin.rego index 3749090b..88c111bb 100644 --- a/checks/kubernetes/cisbenchmarks/apiserver/security_context_deny_plugin.rego +++ b/checks/kubernetes/cisbenchmarks/apiserver/security_context_deny_plugin.rego @@ -9,6 +9,9 @@ # custom: # id: KCV0013 # avd_id: AVD-KCV-0013 +# frameworks: +# k8s-cis-1.23: +# - "1.23" # severity: LOW # short_code: ensure-admission-control-plugin-security-context-deny-is-set-if-pod-security-policy-is-not-used # recommended_action: "Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml on the Control Plane node and set the --enable-admission-plugins parameter to include SecurityContextDeny, unless PodSecurityPolicy is already in place."