SV-254800r961359_rule
V-254800
SRG-APP-000342-CTR-000775
CNTR-K8-002011
CAT I
10
Edit the Kubernetes API Server manifest file in the /etc/kubernetes/manifests directory on the Kubernetes Control Plane.
Set the value of "--admission-control-config-file" to a valid path for the file.
Create an admission controller config file:
Example File:
```yaml
apiVersion: apiserver.config.k8s.io/v1
kind: AdmissionConfiguration
plugins:
- name: PodSecurity
configuration:
apiVersion: pod-security.admission.config.k8s.io/v1beta1
kind: PodSecurityConfiguration
# Defaults applied when a mode label is not set.
defaults:
enforce: "privileged"
enforce-version: "latest"
exemptions:
# Don't forget to exempt namespaces or users that are responsible for deploying
# cluster components, because they need to run privileged containers
usernames: ["admin"]
namespaces: ["kube-system"]
See for more details:
Migrate from PSP to PSA:
https://kubernetes.io/docs/tasks/configure-pod-container/migrate-from-psp/
Best Practice: https://kubernetes.io/docs/concepts/security/pod-security-policy/#recommended-practice.
Change to the /etc/kubernetes/manifests directory on the Kubernetes Control Plane. Run the command:
"grep -i admission-control-config-file *"
If the setting "--admission-control-config-file" is not configured in the Kubernetes API Server manifest file, this is a finding.
Inspect the .yaml file defined by the --admission-control-config-file. Verify PodSecurity is properly configured.
If least privilege is not represented, this is a finding.
V-254800
False
CNTR-K8-002011
Change to the /etc/kubernetes/manifests directory on the Kubernetes Control Plane. Run the command:
"grep -i admission-control-config-file *"
If the setting "--admission-control-config-file" is not configured in the Kubernetes API Server manifest file, this is a finding.
Inspect the .yaml file defined by the --admission-control-config-file. Verify PodSecurity is properly configured.
If least privilege is not represented, this is a finding.
M
5376