CIS Kubernetes Benchmark v2.0.0 - Control 3.2.2
Profile Applicability
- Level: 2 - Master Node
Description
Ensure that the audit policy created for the cluster covers key security concerns.
Rationale
Security audit logs should cover access and modification of key resources in the cluster, to enable them to form an effective part of a security environment.
Impact
Increasing audit logging will consume resources on the nodes or other log destination.
Audit Procedure
Review the audit policy provided for the cluster and ensure that it covers at least the following areas:
- Access to Secrets managed by the cluster. Care should be taken to only log Metadata for requests to Secrets, ConfigMaps, and TokenReviews, in order to avoid the risk of logging sensitive data.
- Modification of
podanddeploymentobjects. - Use of
pods/exec,pods/portforward,pods/proxyandservices/proxy. - Use of the
CertificateSigningRequestAPI which allows for creation of new credentials. - Use of the
Tokensub-resource ofServiceAccountobjects which allows for creation of new credentials.
For most requests, minimally logging at the Metadata level is recommended (the most basic level of logging). Exceptions should be created in the audit logging policy to ensure that system operations (e.g. the Kubelet creating new credentials) are not logged, to reduce operational load and the risk of false positives.
Remediation
Consider modification of the audit policy in use on the cluster to include these items, at a minimum.
Default Value
By default Kubernetes clusters do not log audit information.
References
- https://github.com/k8scop/k8s-security-dashboard/blob/master/configs/kubernetes/adv-audit.yaml
- https://kubernetes.io/docs/tasks/debug-application-cluster/audit/#audit-policy
- https://github.com/kubernetes/kubernetes/blob/master/cluster/gce/gci/configure-helper.sh#L735
CIS Controls
| Controls Version | Control | IG 1 | IG 2 | IG 3 |
|---|---|---|---|---|
| v8 | 8.5 Collect Detailed Audit LogsConfigure detailed audit logging for enterprise assets containing sensitive data. Include event source, date, username, timestamp, source addresses, destination addresses, and other useful elements that could assist in a forensic investigation. | ● | ● | |
| v7 | 14.9 Enforce Detail Logging for Access or Changes to Sensitive DataEnforce detailed audit logging for access to sensitive data or changes to sensitive data (utilizing tools such as File Integrity Monitoring or Security Information and Event Monitoring). | ● |
Profile
Level 2 - Master Node (Manual)