More Info:
When anonymous authentication is enabled, requests not rejected by other authenticators are treated as anonymous and may reach kubelet APIs. Disabling anonymous auth is a hard requirement to prevent unauthenticated control-plane access on nodes.Risk Level
CriticalAddress
Compliance, SecurityCompliance Standards
- CIS OKE
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
To disable anonymous requests to the kubelet in OCI OKE using the OCI Console, you need to update your node pool configuration so kubelet runs with anonymous authentication turned off. In most cases this is done by updating (or recreating) the node pool with the correct kubelet config.Below are the steps in the OCI Console.
If not, you’ll need to specify a kubelet config block (JSON/YAML) through the console field provided.
If you share the exact OKE and Kubernetes version you’re running, I can give the precise field name/syntax for the kubelet configuration in your console view.
1. Confirm your OKE cluster and node pool
- Sign in to the OCI Console.
- Open the navigation menu → Developer Services → Kubernetes Clusters (OKE).
- Select the Compartment where your cluster resides.
- Click your cluster name.
- In the cluster details page, go to the Node Pools tab.
- Identify the node pool(s) whose kubelet configuration you want to fix.
2. Check if node pool kubelet configuration is editable
For many OKE versions, key kubelet security options are controlled via the Kubelet configuration section on the node pool.- In the Node Pools tab, click the node pool name.
- Click Edit or Update (top-right of the node pool details page).
- Expand Advanced Options → Kubelet configuration (or similar wording).
If not, you’ll need to specify a kubelet config block (JSON/YAML) through the console field provided.
3. Set kubelet to disallow anonymous auth
Within the Kubelet configuration section, you must ensure that kubelet is started with--anonymous-auth=false. Depending on what your OKE version exposes:- If there is a toggle/checkbox for anonymous auth:
- Turn off / disable anonymous authentication (or enable “Disable anonymous access”).
- If there is a raw kubelet config field:
- Add or ensure a flag or parameter equivalent to:
anonymousAuth: false
or- an extra-argument that sets
--anonymous-auth=false.
- Add or ensure a flag or parameter equivalent to:
Note: Exact field names can differ slightly by OKE/Kubernetes version. Look for anything documented or labeled around “anonymous authentication”, “anonymous access”, or kubelet security options.
4. Apply changes to worker nodes
Changing the node pool configuration alone does not always immediately reconfigure existing worker nodes. You typically need to recreate the worker nodes so they are started with the updated kubelet settings.You have two main options:Option A – Rolling replacement within the same node pool (if supported):
- After saving the updated node pool configuration, scale the node pool up by adding new nodes.
- Wait for the new nodes to become Active and join the cluster.
- Cordon and drain old nodes (from
kubectl): - In the OCI Console, terminate the old nodes from the node pool.
- Repeat for each old node until all nodes in the node pool are newly created with the updated kubelet config.
Option B – Create a new node pool (cleaner approach):
- In the cluster page, go to Node Pools → Create node pool.
- Configure it identically (shape, images, labels, taints, etc.) but:
- Under Advanced Options → Kubelet configuration, set anonymous auth to disabled as described above.
- Create the node pool and wait for nodes to become Active.
- Use
kubectlto cordon and drain nodes from the old node pool, then:- In the console, delete the old node pool once workloads are safely running on the new pool.
5. Verify that anonymous auth is disabled
After nodes with the new configuration are running:- Get the node IPs:
- From a pod (or a secure bastion) with network access to node IPs, verify kubelet no longer accepts anonymous requests (for example, an unauthenticated curl to kubelet’s read-only port or API should now fail).
If you share the exact OKE and Kubernetes version you’re running, I can give the precise field name/syntax for the kubelet configuration in your console view.
Using CLI
Using CLI
To disable anonymous requests to the kubelet on OKE worker nodes, you need to change the kubelet configuration on each node so that:
Note the This returns the compute instance OCIDs for the worker nodes.
Use that IP for SSH.
(Use
Where
Optionally, from within the node, query the kubelet config endpoint and ensure anonymous access fails (or needs auth).
If you share your specific OKE node OS image and version (Oracle Linux vs Ubuntu, managed vs custom), I can give you the exact file paths and edit commands for that image.
--anonymous-auth=falseis set (or)authentication: anonymous: enabled: falseis set in the kubelet config file
1. Get the node pool and node OCIDs
id (nodePoolId) you want to remediate.2. Get each node’s public IP (via OCI CLI)
For each worker instance OCID:3. SSH to each node
ubuntu or other user if your image differs.)4. Update kubelet config on the node
On each node:-
Locate the kubelet config file (for OKE it is usually
/var/lib/kubelet/config.yaml): -
Ensure anonymous auth is disabled. The
authenticationsection should look like:Ifanonymous.enabledistrueor missing, edit the file:Add/modify:If the node is using flags instead of config.yaml, edit the kubelet systemd unit or environment file (often/etc/systemd/system/kubelet.service.d/10-kubelet-args.confor similar) and ensure: -
Reload systemd and restart kubelet:
-
Verify kubelet is healthy:
5. (Optional) Bake this into node boot/launch
Because OKE re‑creates worker nodes (e.g., during scaling or upgrades), you should ensure new nodes get the same setting automatically. You can do this by:- Using a custom image where
/var/lib/kubelet/config.yamlalready hasanonymous.enabled: false, or - Using cloud-init/bootstrapping scripts in the instance’s metadata.
-
Identify the instance configuration used by the node pool:
Look for
nodeConfigDetails→placementConfigs/ instance details, then trace back to the instance configuration (if used) via Compute → Instance Configurations. - Update that instance configuration’s metadata to include a cloud-init script that enforces the kubelet config on boot.
kubelet-hardening.yaml is a cloud-init script that edits /var/lib/kubelet/config.yaml to set authentication.anonymous.enabled: false and restarts kubelet.6. Validate from the cluster
From a machine withkubectl access:If you share your specific OKE node OS image and version (Oracle Linux vs Ubuntu, managed vs custom), I can give you the exact file paths and edit commands for that image.
Using Python
Using Python
To disable anonymous requests to the kubelet for Oracle OKE using Python, you need to:
- Configure the kubelet on each node pool to run with
--anonymous-auth=false(and preferably disable the read-only port). - Do this via an OKE Node Pool update using the OCI Python SDK (which will roll the nodes).
1. Prerequisites
- Python 3.x
- OCI Python SDK:
- An OCI config file (
~/.oci/config) with a profile that has:- Permission to
MANAGEclusters and node pools in the target compartment.
- Permission to
- Your OKE cluster OCID and/or node pool OCIDs.
2. High-level actions
For each node pool in your OKE cluster:- Get the node pool definition.
- Update its kubelet configuration to:
anonymous-auth = false- (Optionally)
read-only-port = 0for extra hardening.
- Call
UpdateNodePoolvia the OCI Container Engine client. - Wait for the node pool to complete its rolling update.
3. Example Python script
This example:- Lists node pools for a given cluster.
- Updates each node pool’s kubelet config to disable anonymous auth.
CONFIG section.4. Notes
- Updating node pools this way typically triggers a rolling replacement of nodes; plan for impact.
- Ensure your OKE version/API supports
kubeletConfigon node pools; if it doesn’t, you must instead use a custom cloud-init or image that sets--anonymous-auth=falseon kubelet before OKE manages the node. - After completion, validate on a node:
get_node_pool output, I can tailor the exact fields to your environment.Using Terraform
Using Terraform
kubelet_config.is_anonymous_auth_enabled does not force replacement of the node pool resource itself, but OKE will roll nodes to apply the new kubelet configuration (expect node recreation / disruption during the rollout).To verify, terraform plan should show an in-place update on oci_containerengine_node_pool.OKE_NODEPOOL with kubelet_config.is_anonymous_auth_enabled changing from true (or null) to false.
