Skip to main content

More Info:

Setting rotateCertificates to true allows kubelet to automatically renew its client certificate before expiry. Without rotation, expired certs cause node outages and long-lived credentials raise the impact of compromise.

Risk Level

Medium

Address

Compliance, Security

Compliance Standards

  • CIS OKE

Triage and Remediation

Remediation

Using Console

To remediate this in OCI OKE via the Console, you need to enable Kubelet certificate auto-rotation on the cluster.Prerequisites
  • You must be using VNIC-native Pod networking (required for kubelet cert rotation in OKE).
  • You need permissions to update OKE clusters in the compartment.

1. Confirm the Cluster Networking Type

  1. Sign in to the OCI Console.
  2. Open the Navigation MenuDeveloper ServicesKubernetes Clusters (OKE).
  3. Select the Compartment where your cluster resides.
  4. Click your Cluster name.
  5. On the cluster Details page, check:
    • Cluster Type / Networking:
      • If it shows something like “Native VCN / VCN-native pods (VNP)” or similar wording, you’re using VNIC-native Pod networking.
      • If you are on older Flannel/Overlay networking, kubelet cert auto-rotation will not be available; you would need to create a new cluster with VCN-native Pod networking and migrate workloads.
If you confirm the cluster is using VNIC-native Pod networking, proceed.

2. Enable Kubelet Client Certificate Auto-Rotation

  1. Still on the Cluster Details page for your OKE cluster:
  2. In the top-right corner, click Edit Cluster (or Update Cluster depending on UI version).
  3. Look for the Security or Kubernetes Configuration section; the exact wording can vary, but find:
    • Kubelet client certificate auto-rotation
    • Or Enable kubelet certificate rotation
  4. Check/enable the option:
    • Example: Tick Enable kubelet client certificate auto-rotation.
  5. Click Save changes / Update.
The change applies at the cluster level; newly created or restarted nodes in the node pools will honor the setting and rotate kubelet client certificates automatically before expiration.

3. (If Needed) Cycle Nodes to Pick Up the Setting

If the setting was just enabled on an existing cluster and node pools:
  1. From the cluster page, go to Node Pools.
  2. For each node pool:
    • Option A: Rolling restart / Rolling replace nodes if the UI provides that.
    • Option B: Manually:
      • Drain and terminate nodes one at a time, allowing the node pool to recreate them, so new nodes start with the updated cluster config.
  3. Verify nodes come back to Active status and workloads reschedule successfully.

4. Validate Kubelet Cert Rotation

From a workstation with kubectl access:
  1. List kubelet certificates on a node (via SSH) or check kubelet logs to confirm:
    • Certificates now have a shorter lifetime and are renewed periodically.
  2. Optionally, use kubectl get csr (if your OKE version exposes CSRs) to see certificate signing requests being created/approved over time.
This configuration should clear the “OCI OKE Kubelet Client Certificates Should Be Auto-Rotated” finding.
Below is a CLI‑only way to enable kubelet client certificate auto‑rotation on an OKE cluster.
Note: Field names can change slightly between CLI versions. I’ll show you how to discover the exact flag via the CLI itself so you’re not guessing.

1. Make sure you have a recent OCI CLI


2. Discover the cluster options payload structure

Generate the full JSON skeleton for update-cluster:
Open cluster-update.json and look for the options section. You should see something like:
If you don’t see isKubeletCertificateRotationEnabled, upgrade the CLI and re‑check; if it uses a different name, use that exact field instead.

3. Create a minimal options JSON file

Create a file oke-kubelet-rotation-options.json with only the fields you want to change. For example:
If your existing cluster already uses options like serviceLbSubnetIds, addOns, etc., include them as well so they don’t get cleared. You can grab the current options from:
Then edit current-options.json to set:
and save it as oke-kubelet-rotation-options.json.

4. Apply the update to the cluster

Replace <cluster_ocid> with your OKE cluster OCID.

5. Verify the setting

Should return:

This enables kubelet client certificate auto‑rotation for that OKE cluster using OCI CLI.
In OKE, kubelet client certificate auto-rotation is controlled per node pool via the is_kubelet_certificate_rotation_enabled flag.
To remediate, you need to enable this on every node pool in your clusters using the OCI Python SDK.
Below is a concise step‑by‑step with Python code.

1. Prerequisites

  1. Install the OCI Python SDK:
  1. Configure OCI credentials (one of):
    • ~/.oci/config with a profile (e.g. DEFAULT), or
    • Instance principal / resource principal (if running on OCI).
~/.oci/config example:

2. Enable kubelet certificate rotation for all node pools in a compartment

This script:
  • Connects to OKE (Container Engine for Kubernetes).
  • Lists all node pools in a given compartment (optionally filtered by cluster).
  • Updates each node pool to set is_kubelet_certificate_rotation_enabled=True if not already set.

3. Notes / Operational Considerations

  • Rolling update: update_node_pool triggers a rolling update of the node pool. Plan for some disruption; ensure PodDisruptionBudgets and replicas are configured.
  • Per‑node‑pool: You must run this for each node pool in each cluster that should have rotation enabled.
  • Idempotent: Re-running the script is safe; it skips pools where rotation is already enabled.
  • Validation: After completion, describe the node pool and confirm isKubeletCertificateRotationEnabled shows as true in:
    • OCI Console → OKE → Node Pools, or
    • get_node_pool via SDK/CLI.