Cluster logging and secrets
Separate secret data from evidence
A Kubernetes Secret stores sensitive values for workloads; base64 representation is not encryption. Configure encryption at rest for the Secret API data, restrict access and protect backups. Deliver only the required secret to each workload. Prefer short-lived credentials and use an approved external secret store when appropriate.
API audit versus workload logs
API server audit events describe API requests; application logs describe application behavior; network and runtime telemetry describe other layers. In Kubernetes v1.35, audit level Metadata records request metadata without request or response bodies. Use it for sensitive resource access; audit policies still need correct ordering, collection and protected storage.
Design a minimal event
Example of a normalized synthetic record, not a native audit event:
{ "id": "E01", "actor": "reports/renderer", "verb": "get", "resource": "configmaps", "namespace": "reports", "status": 200, "time": "2026-01-01T10:00:00Z"}It supports a review of who accessed which kind of resource and when. A status of 200 does not establish that the action was business-authorized. Use an allowlist of fields; omit tokens, request bodies and secret values.
Avoid missing or excessive evidence
Logging every response body can disclose sensitive information. A silent audit stream could mean collection is broken, not that no requests occurred. Protect audit storage from workload identities, monitor ingestion, set retention with the data owner, and check that rotation reaches consumers. A secret update alone is not proof that all processes use the replacement.
Practice evidence and recovery
A fictional audit record shows denied Secret access and a second stream is missing. Record the denial, investigate authorized owner intent and restore collection; do not claim a breach or absence of compromise. Plan a rotation verification and rollback using test credentials only. See chapter 35 on telemetry and chapter 32 on key lifecycle.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Cluster logging and secrets — knowledge check
Review container trust, runtime, access and telemetry.
What does base64 provide?
What does Metadata audit level omit?
Which is a safe logging choice?
What does absence of delivered logs prove?
What verifies a secret rotation?