Interview Prep/Kubernetes/Security: RBAC, ServiceAccounts & Pod Security

How do audit logs work and what policy would you start with?

AdvancedConceptSecurity: RBAC, ServiceAccounts & Pod Security
Answer

The API server writes audit events per stage (RequestReceived, ResponseStarted, ResponseComplete) according to an audit.k8s.io/v1 Policy with levels None, Metadata, Request, RequestResponse. A sane start: Metadata for most, RequestResponse for RBAC and exec/attach, omit noisy gets from system users, and never log Secret bodies. On EKS enable the audit log type to CloudWatch.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Security: RBAC, ServiceAccounts & Pod Security