Skip to main content

More Info:

The kubelet read-only port (10255) exposes node and pod information without authentication. It must be disabled (set to 0) so attackers on the node network cannot enumerate workloads or fingerprint the cluster.

Risk Level

High

Address

Compliance, Security

Compliance Standards

  • CIS OKE

Triage and Remediation

Remediation

Using Console

To disable the kubelet read-only port in OCI OKE you must configure the node pools so that kubelet is started with --read-only-port=0. This is done via node pool configuration in the OCI Console; it cannot be toggled at the cluster level.Below are the steps (console-only) for both new and existing node pools.
  1. Sign in to the OCI Console
    • Go to: Developer Services → Kubernetes Clusters (OKE).
  2. Open your cluster
    • Click your Compartment.
    • Click your Cluster name.
  3. Start creating a new node pool
    • In the cluster details page, go to the Node Pools tab.
    • Click Create node pool.
  4. Fill in basic details
    • Name, Kubernetes version, shape, image, subnet, etc., as per your requirements.
  5. Configure kubelet to disable read-only port
    • In the Advanced options or Node configuration section (exact label can vary by UI version), look for:
      • Kubelet configuration, Kubelet arguments, or Custom cloud-init / user data.
    • You need to ensure kubelet runs with:
    • How you set this depends on what your UI offers:
    If your console has “Kubelet arguments” / “Kubelet configuration” fields:
    • Add an extra argument:
      • Key: read-only-port
      • Value: 0 (or equivalent format in a JSON/YAML field like:
    If there is no explicit kubelet field but a “Custom cloud-init / User data” field:
    • Add a cloud-init script that edits the kubelet service before it starts. Example (Ubuntu-style):
    • Adapt path/file if your image uses a different kubelet config mechanism.
  6. Create the node pool
    • Click Create.
    • Wait until the node pool status is Active and all nodes are Ready.
  7. Move workloads to the new node pool
    • In your cluster (via kubectl), cordon and drain nodes from the old node pool, then delete the old node pool from the Node Pools tab once all workloads have been rescheduled.
    • This is the safe way to roll to kubelets with read-only-port disabled.

2. For an existing node pool (no direct toggle)

OKE does not provide an in-place checkbox to change kubelet flags for an existing node pool via the Console. To remediate an existing pool from the console only, the usual pattern is:
  1. Create a new node pool following Section 1 with --read-only-port=0.
  2. Cordon & drain old nodes (using kubectl; console does not do this automatically for pods).
  3. Delete the old node pool in the OKE Console when no longer used.

3. Verify kubelet read-only port is disabled

After the new nodes are up and workloads have moved:
  1. SSH to one of the worker nodes (if permitted by your security rules).
  2. Check kubelet process:
    It should show:
  3. Alternatively, from a pod on that node, confirm that port 10255 is not reachable:
    It should fail to connect.

If you share what options you see under Create node pool → Advanced options in your console, I can give you the exact field names and JSON/YAML structure to paste.
For Oracle Container Engine for Kubernetes (OKE) you generally don’t disable the kubelet read-only port yourself; it’s controlled by the OKE control plane:
  • For all current/modern OKE Kubernetes versions, the kubelet readOnlyPort is already disabled by default and cannot be enabled.
  • If a security scanner is flagging this on an OKE-managed node pool, it’s usually a false positive or based on an old OKE version.
So the only “remediation” that’s actually under your control via OCI CLI is:
  1. Ensure the cluster is on a supported/modern Kubernetes version
  2. Ensure all node pools are upgraded to that version
Below are the minimal OCI CLI steps to do that.

1. List your clusters and get the OCID


2. Check available Kubernetes versions for OKE

Pick a current supported version (for example: v1.29.x or similar).

3. Upgrade the cluster control plane

Wait until the update completes.

4. List node pools for this cluster

Note each node pool OCID.

5. Upgrade each node pool to the same version

For each node pool:
OKE will roll your worker nodes to the new version, using the OKE-managed kubelet configuration (with the read-only port disabled).

6. (Optional) Verify from a node

If you have SSH access to a worker node, you can confirm the port is not listening:

Key point:
On managed OKE node pools you cannot set or unset readOnlyPort via OCI CLI; compliance is achieved by running on a current OKE version, where the kubelet read-only port is disabled by design.
To disable the kubelet read-only port in OCI OKE with Python, you must:
  • Set the kubelet flag --read-only-port=0 via the node pool’s kubeletConfig
  • Then roll/replace the nodes in that pool so the new config takes effect
Below are step‑by‑step instructions and example Python code using the OCI Python SDK.

1. Prerequisites

  1. Install OCI SDK:
  1. Make sure you have an OCI config file (~/.oci/config) with a profile that has rights to manage OKE node pools:
  1. You need:
    • compartment_id (OCID)
    • cluster_id (OCID) – optional if you already know the node pool OCID
    • node_pool_id (OCID) of the node pool to modify

2. Update node pool kubelet config (read-only-port=0)

OKE lets you set kubelet flags via kubelet_config (a key/value map) on the node pool. You want to ensure:
Python example:
Notes:
  • You must preserve all required existing fields (size, placement_configs, node_source_details, etc.) when constructing UpdateNodePoolDetails, otherwise you may unintentionally change them.
  • If your SDK version has additional required attributes, mirror them from node_pool into update_details.

3. Roll / recycle the nodes in the pool

The new kubelet arguments are applied when new nodes are created. For existing nodes, you must replace them (cordon/drain then terminate) so OKE recreates nodes with the new config.Minimal approach:
  1. Cordoning & draining (via kubectl; optional but strongly recommended before termination):
  1. Terminate nodes so they’re recreated via OCI SDK or Console.
With Python/SDK you can rotate nodes one by one (simple illustration):
OKE will recreate terminated worker nodes according to the node pool definition, now with --read-only-port=0 in kubelet arguments.

4. Verify the kubelet read-only port is disabled

Once new nodes are ready:
  1. SSH into a worker node (if allowed) and check kubelet process args:
You should see --read-only-port=0 (or no --read-only-port at all, which defaults to disabled on newer versions).
  1. From inside the cluster, confirm the read-only port isn’t listening (default would be 10255):

5. Apply to all node pools programmatically (optional)

You can loop over all node pools in a cluster and enforce this setting:
Then roll nodes as in step 3.
If you share your current SDK version and how your node pools are structured (e.g., managed vs. custom node images), I can adjust the exact model fields and filters for your environment.
This setting is not exposed by the oci_containerengine_node_pool resource or any other current OKE-related Terraform resource, so Terraform cannot directly set the kubelet read-only port to 0; follow Oracle’s OKE documentation for the exact Console/API steps.Verification: terraform plan will show no changes related to kubelet or port 10255, since the provider does not manage that field.