| name | cis-k8s-v1110-4.2.8 |
| description | Ensure that the eventRecordQPS argument is set to a level which ensures appropriate event capture (Manual) |
| category | cis-k8s |
| version | 1.11.0 |
| author | cyberstrike-official |
| tags | ["cis","kubernetes","worker-node","kubelet","event-record-qps","logging"] |
| cis_id | 4.2.8 |
| cis_benchmark | CIS Kubernetes Benchmark v1.11.0 |
| tech_stack | ["kubernetes"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
4.2.8 Ensure that the eventRecordQPS argument is set to a level which ensures appropriate event capture (Manual)
Profile Applicability
Description
Security relevant information should be captured. The eventRecordQPS on the Kubelet configuration can be used to limit the rate at which events are gathered and sets the maximum event creations per second. Setting this too low could result in relevant events not being logged, however the unlimited setting of 0 could result in a denial of service on the kubelet.
Rationale
It is important to capture all events and not restrict event creation. Events are an important source of security information and analytics that ensure that your environment is consistently monitored using the event data.
Impact
Setting this parameter to 0 could result in a denial of service condition due to excessive events being created. The cluster's event processing and storage systems should be scaled to handle expected event loads.
Audit
Run the following command on each node:
sudo grep "eventRecordQPS" /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
or If using command line arguments, kubelet service file is located /etc/systemd/system/kubelet.service.d/10-kubelet-args.conf
sudo grep "eventRecordQPS" /etc/systemd/system/kubelet.service.d/10-kubelet-args.conf
Review the value set for the argument and determine whether this has been set to an appropriate level for the cluster.
If the argument does not exist, check that there is a Kubelet config file specified by --config and review the value in this location.
If using command line arguments
Remediation
If using a Kubelet config file, edit the file to set eventRecordQPS: to an appropriate level.
If using command line arguments, edit the kubelet service file /etc/systemd/system/kubelet.service.d/10-kubeadm.conf on each worker node and set the below parameter in KUBELET_ARGS variable.
Based on your system, restart the kubelet service. For example:
systemctl daemon-reload
systemctl restart kubelet.service
Default Value
By default, eventRecordQPS argument is set to 5.
References