Courseiva
mediumMultiple Choice

CKS Practice Question: You run 'kube-bench' on a cluster node and get a…

You run 'kube-bench' on a cluster node and get a failure for the test 'Ensure that the --anonymous-auth argument is set to false' (ID: 1.2.1). Which file do you need to modify to fix this issue?

⚠ Common exam trap

Watch out — candidates often confuse the kubelet configuration file (`/var/lib/kubelet/config.yaml`) with the API server manifest, but the `--anonymous-auth` flag is specific to the API server, not the kubelet.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

/etc/kubernetes/manifests/kube-apiserver.yaml

The kube-bench test ID 1.2.1 checks the kube-apiserver configuration for the `--anonymous-auth` flag. The API server is a static pod managed by the kubelet, and its configuration is defined in the manifest file `/etc/kubernetes/manifests/kube-apiserver.yaml`. To fix the failure, you must edit this file to set `--anonymous-auth=false`.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    /etc/kubernetes/kubelet.conf

    Why it's wrong here

    This is a kubeconfig file used by the kubelet to authenticate to the API server, containing client certificates and server endpoint, not the API server's own configuration. kube-bench checks for API server flags like --anonymous-auth, --insecure-port, etc., which are set in the static pod manifest or the API server's systemd unit, not in this kubeconfig.

  • ✓

    /etc/kubernetes/manifests/kube-apiserver.yaml

    Why this is correct

    In kubeadm-deployed clusters, control plane components run as static pods, and their manifests live in /etc/kubernetes/manifests. kube-bench inspects this YAML for hardening settings such as --authorization-mode=RBAC, --anonymous-auth=false, --secure-port, --tls-cipher-suites, and --service-account-lookup. Modifying flags here and restarting kubelet (or moving the file) changes API server behavior for kube-bench validation.

  • ✗

    /etc/kubernetes/pki/

    Why it's wrong here

    This directory stores the cluster's CA, server certs, and keys like apiserver.crt and apiserver.key. While the API server references these paths in its manifest, kube-bench's API server tests evaluate runtime flags or manifest settings, not the presence or permissions of certificate files. Certificates are tested separately in kube-bench's 'Control Plane Configuration' file permissions checks, so this directory is not where the reported failure is resolved.

  • ✗

    /var/lib/kubelet/config.yaml

    Why it's wrong here

    This is the kubelet's own configuration file (KubeletConfiguration), specifying kubelet behaviors like staticPodPath, clusterDNS, and authentication settings for the kubelet's own serving endpoints. It does not control API server flags such as --anonymous-auth or --authorization-mode. Editing it affects kubelet hardening, which kube-bench tests under 'Worker Node Configuration', not the API server checks that are failing.

About these practice questions

One of 845 original CKS practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This CKS practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKS exam.