Drag or tap steps into the slots.
CKS Cluster Hardening Practice Question
Arrange the steps to enable and configure audit logging in Kubernetes.
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
1. Create audit policy file, 2. Mount policy file to API server, 3. Add audit flags to API server, 4. Restart API server, 5. Verify audit logs
Audit logging requires a policy file, mounting it, adding flags, restarting, and verifying logs.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
1. Create audit policy file, 2. Mount policy file to API server, 3. Add audit flags to API server, 4. Restart API server, 5. Verify audit logs
Why this is correct
This is the correct order because the audit policy file must be created first, then mounted to the API server so it is accessible, then flags are added to reference the file, then the API server is restarted to apply changes, and finally verification ensures audit logging is working correctly.
- ✗
1. Add audit flags to API server, 2. Create audit policy file, 3. Mount policy file to API server, 4. Restart API server, 5. Verify audit logs
Why it's wrong here
This order is incorrect because audit flags reference the policy file path, but the file does not exist yet. Adding flags before creating and mounting the policy file will cause the API server to fail to start or ignore the flags.
- ✗
1. Create audit policy file, 2. Add audit flags to API server, 3. Mount policy file to API server, 4. Restart API server, 5. Verify audit logs
Why it's wrong here
This order is incorrect because adding audit flags before mounting the policy file means the API server cannot access the policy file at startup, leading to errors or the flags being ignored. The mount must precede the flag addition.
- ✗
1. Create audit policy file, 2. Mount policy file to API server, 3. Restart API server, 4. Add audit flags to API server, 5. Verify audit logs
Why it's wrong here
The restart occurs before the audit flags are added, so the API server never loads the audit configuration during that restart. Since kube-apiserver reads command-line flags (e.g., --audit-policy-file, --audit-log-path) only at process startup, adding them afterward leaves the running process unaware of them and requires a second restart to take effect. Even though the policy file is already mounted, without the flags the API server will not enable audit logging. Therefore, the correct order must place the flag addition before the restart, after the policy file is mounted and accessible.
Go deeper
Related to this question
About these practice questions
This CKS question is part of Courseiva's 845-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
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.