| name | cis-aks-v180-3.2.5 |
| description | Ensure that the --streaming-connection-idle-timeout argument is not set to 0 (Automated) |
| category | cis-aks |
| version | 1.8.0 |
| author | cyberstrike-official |
| tags | ["cis","aks","kubernetes","azure","kubelet","streaming-connection","idle-timeout"] |
| cis_id | 3.2.5 |
| cis_benchmark | CIS Azure Kubernetes Service (AKS) Benchmark v1.8.0 |
| tech_stack | ["kubernetes","azure","aks"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
3.2.5 Ensure that the --streaming-connection-idle-timeout argument is not set to 0 (Automated)
Profile Applicability
Description
Do not disable timeouts on streaming connections.
Rationale
Setting idle timeouts ensures that you are protected against Denial-of-Service attacks, inactive connections and running out of ephemeral ports.
Note: By default, --streaming-connection-idle-timeout is set to 4 hours which might be too high for your environment. Setting this as appropriate would additionally ensure that such streaming connections are timed out after serving legitimate use cases.
Impact
Long-lived connections could be interrupted.
Audit Procedure
Audit Method 1:
First, SSH to the relevant node:
Run the following command on each node to find the running kubelet process:
ps -ef | grep kubelet
If the command line for the process includes the argument streaming-connection-idle-timeout verify that it is not set to 0.
If the streaming-connection-idle-timeout argument is not present in the output of the above command, refer instead to the config argument that specifies the location of the Kubelet config file e.g. --config /etc/kubernetes/kubelet/kubelet-config.json.
Open the Kubelet config file:
cat /etc/kubernetes/kubelet/kubelet-config.json
Verify that the streamingConnectionIdleTimeout argument is not set to 0.
Audit Method 2:
If using the api configz endpoint consider searching for the status of "streamingConnectionIdleTimeout":"4h0m0s" by extracting the live configuration from the nodes running kubelet.
Set the local proxy port and the following variables and provide proxy port number and node name; HOSTNAME_PORT="localhost-and-port-number" NODE_NAME="The-Name-Of-Node-To-Extract-Configuration" from the output of kubectl get nodes
kubectl proxy --port=8001 &
export HOSTNAME_PORT=localhost:8001 (example host and port number)
export NODE_NAME=ip-192.168.31.226.aks.internal (example node name from "kubectl get nodes")
curl -sSL