Profile Applicability:
• Level 1
Description:
Do not allow all requests. Ensure that explicit authorization is enforced by setting the authorization-mode to Webhook instead of AlwaysAllow.
Rationale:
Kubelets configured with authorization-mode=AlwaysAllow permit all authenticated (and sometimes even anonymous) requests without any additional authorization checks. This creates a significant security gap. Setting the mode to Webhook ensures requests are subject to authorization decisions based on RBAC or external webhook services.
Impact:
Pros:
Enforces strict access control for kubelet operations.
Prevents privilege escalation and unauthorized node access.
Ensures kubelet only serves requests from authorized users/services.
Cons:
May deny requests that previously worked under AlwaysAllow.
Requires a properly configured authorization system (Webhook or RBAC).
Default Value:
May vary depending on the Kubernetes version and base AMI. Check AWS EKS-specific documentation.
Pre-requisites:
SSH or Session Manager access to the worker nodes.
Permissions to view and edit Kubelet config or service definition files.
Ability to restart systemd services (for systemd-based environments).
Kubernetes access to test via configz or deploy a privileged pod.
Remediation
Test Plan:
Using AWS Console:
Go to Amazon EC2 > Instances, connect to a worker node using Session Manager or EC2 Instance Connect.
Run the following command to check the kubelet process and find config file path:
ps -ef | grep kubelet
Open the config file using:
sudo less /path/to/kubelet-config.json
Check the following entry exists:
"authorization": { "mode": "Webhook" }Also verify that the --authorization-mode flag is not set to AlwaysAllow.
Using AWS CLI:
Get the list of nodes:
kubectl get nodes
Start a proxy to use /configz:
kubectl proxy --port=8080
In a new terminal:
export NODE_NAME=my-node-name curl http://localhost:8080/api/v1/nodes/${NODE_NAME}/proxy/configz
Check the returned JSON contains:
"authorization": { "mode": "Webhook" }
Confirm it's not set to AlwaysAllow.
Implementation Plan
Using AWS Console:
Connect to the worker node using EC2 or Session Manager.
Run ps -ef | grep kubelet and locate the --config argument if present.
Open the config file and ensure the following entry is set:
"authorization": { "mode": "Webhook" }
If using systemd (EKS Optimized AMIs), navigate to:
/etc/systemd/system/kubelet.service.d/10-kubelet-args.conf
Ensure the following line is added or modified:
--authorization-mode=Webhook
Save the changes and restart the kubelet service.
Using AWS CLI:
Edit the kubelet config file on the node and ensure the following is present:
"authorization": { "mode": "Webhook" }
Or modify the systemd unit file and add:
--authorization-mode=Webhook
Restart services:
systemctl daemon-reload systemctl restart kubelet.service systemctl status kubelet -l
Backout Plan
Using AWS Console:
Reconnect to the node.
Revert any changes made to the kubelet config file or service files.
Restart kubelet after rollback.
Using AWS CLI:
Remove or reset the --authorization-mode flag if needed.
Reapply the previous config file version if backed up.
Restart kubelet:
systemctl daemon-reload systemctl restart kubelet.service
References:
Kubelet Authentication and Authorization