Skip to content

KCSA · Domain 3: Kubernetes Security Fundamentals · 22% of the exam

Task 3.7: Audit Logging

Audit stages and levels, writing an audit Policy, log and webhook backends, and what an audit trail can show after an incident.

Study it

  • Audit logging

    Lesson coming

Sample questions

Try each one before opening the answer. Every option is explained, with the CNCF documentation page that proves it.

Question 1 · choose 1

An API server's audit log has doubled in size because most requests now produce two events, one when the request is received and one when the response is complete. The security team still needs one event per request that includes the final response status. What should the audit policy set?

  1. AomitStages: ["RequestReceived"]
  2. Blevel: None for all read requests
  3. CThe webhook backend with batching enabled
  4. DomitStages: ["ResponseComplete"]
Show the answer and why
  • AomitStages: ["RequestReceived"]

    Correct

    RequestReceived events are generated as soon as a request arrives; omitting that stage keeps the ResponseComplete event, which is written once the response is done.

  • Blevel: None for all read requests

    Incorrect

    That drops every event for reads, so those requests would have no event at all.

  • CThe webhook backend with batching enabled

    Incorrect

    Batching changes how events are delivered, not how many are generated.

  • DomitStages: ["ResponseComplete"]

    Incorrect

    That keeps the event written on arrival and drops the one written when the response finishes, which carries the final status.

An audit event can be recorded at several stages of a request. omitStages in the policy removes the stages listed; omitting RequestReceived leaves the ResponseComplete event, one per request with the response status, as the documentation's example policy does.

Question 2 · choose 1

Which audit level logs the request metadata and request body of matching events, but not the response body?

  1. ARequestResponse
  2. BNone
  3. CResponseComplete
  4. DRequest
Show the answer and why
  • ARequestResponse

    Incorrect

    RequestResponse logs the response body as well.

  • BNone

    Incorrect

    None logs nothing for matching events.

  • CResponseComplete

    Incorrect

    ResponseComplete is a stage of request processing, not an audit level.

  • DRequest

    Correct

    The auditing documentation defines Request as logging event metadata and the request body, but not the response body.

Audit levels set how much of each event is recorded. Request records the event metadata and the request body; RequestResponse records the response body as well; None records nothing. Stages such as ResponseComplete describe when an event is generated, not how much of it is kept.

Question 3 · choose 1

For which requests does the API server generate audit events in the ResponseStarted stage?

  1. AOnly long-running requests, such as watch
  2. BEvery request, as soon as it arrives
  3. COnly requests that cause a panic
  4. DOnly requests that are rejected by admission
Show the answer and why
  • AOnly long-running requests, such as watch

    Correct

    The auditing documentation says the ResponseStarted stage is generated only for long-running requests, for example watch.

  • BEvery request, as soon as it arrives

    Incorrect

    Events generated as soon as a request arrives belong to the RequestReceived stage.

  • COnly requests that cause a panic

    Incorrect

    Those produce events in the Panic stage.

  • DOnly requests that are rejected by admission

    Incorrect

    Rejection does not define a separate audit stage.

The audit stages are RequestReceived, ResponseStarted, ResponseComplete and Panic. ResponseStarted, after headers are sent and before the body, occurs only for long-running requests such as watch.

Practice domain 3 →Practice all domains →