mediumMultiple ChoiceObjective-mapped
CKS Enable audit logging on the API server Practice Question
An administrator wants to enable audit logging on the API server. Which three flags are required to set up basic audit logging?
⚠ Common exam trap
CNCF often tests the misconception that `--audit-log-format=json` is required for basic audit logging, when in fact JSON is the default format and the flag is optional, leading candidates to select it as a required flag.
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
✓
--audit-log-maxage=30
For basic audit logging in Kubernetes, three flags are required: `--audit-log-path` specifies the file path for audit logs, `--audit-policy-file` defines the policy controlling which events are logged, and `--audit-log-maxage` sets the retention period in days. These ensure logging is enabled, filtered, and rotated. The `--audit-log-format` flag is optional because JSON is the default, and `--audit-log-maxbackup` and `--audit-log-maxsize` can be added but are not required for basic setup.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
--audit-log-maxage=30
Why this is correct
Sets the retention period for audit logs in days; required for basic audit logging to manage disk usage.
- ✗
--audit-log-format=json
Why it's wrong here
JSON is the default format for audit logs; this flag is optional and not required for basic setup.
- ✓
--audit-log-path=/var/log/kubernetes/audit.log
Why this is correct
Specifies the file path where audit logs are written; required to enable audit logging.
- ✓
--audit-policy-file=/etc/kubernetes/audit-policy.yaml
Why this is correct
Defines a policy file that controls which events are logged; required to filter audit events according to policy.
Go deeper
Related to this question
About these practice questions
This CKS question is part of Courseiva's 114-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 →
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.