Ensure that the --repair-malformed-updates argument is set to false (API Server)

Disable fixing of malformed updates. The API Server will potentially attempt to fix the update requests to pass the validation even if the requests are malformed. Malformed requests are one of the potential ways to interact with a service without legitimate information. Such requests could potentially be used to sabotage API Server responses.

Risk Level: High
Cloud Entity: Pods
CloudGuard Rule ID: D9.K8S.NET.09
Covered by Spectral: Yes
Category: Compute

GSL LOGIC

KubernetesPod where labels contain [value='kube-apiserver'] and namespace = 'kube-system' should have spec.containers with [parsedArgs contain [key like 'repair-malformed-updates' and value = 'false']]

REMEDIATION

Edit the API server pod specification file $apiserverconf
on the master node and set the below parameter.
--repair-malformed-updates=false

Pods

Pods are the smallest deployable units of computing that can be created and managed in Kubernetes.A Pod is a group of one or more containers (such as Docker containers), with shared storage/network, and a specification for how to run the containers.

Compliance Frameworks

  • CIS Kubernetes Benchmark v1.4.0
  • Kubernetes NIST.SP.800-190
  • Kubernetes v.1.13 CloudGuard Best Practices
  • Kubernetes v.1.14 CloudGuard Best Practices