Skip to main content

More Info:

Kubelet server certificates should be rotated automatically (via RotateKubeletServerCertificate) so kubelets serving cert is short-lived and approved by the API server, reducing the window of misuse for stolen serving keys.

Risk Level

Medium

Address

Compliance, Security

Compliance Standards

  • CIS OKE

Triage and Remediation

Remediation

Using Console

Below are step‑by‑step remediation steps using the OCI Console to ensure kubelet server certificates are auto‑rotated for OKE node pools.
Prerequisites
  • You must have permissions to manage OKE clusters and node pools in the target compartment.
  • The cluster/node pool must be on a Kubernetes version that supports kubelet certificate rotation (all recent OKE versions do).

1. Identify the OKE cluster and node pools

  1. In the OCI Console, open the Navigation menu (≡).
  2. Go to Developer ServicesKubernetes Clusters (OKE).
  3. Choose the appropriate Compartment from the left-side compartment selector.
  4. Click the Cluster that corresponds to the misconfiguration finding.
  5. In the cluster details page, go to the Node Pools tab.
  6. Identify the node pool(s) associated with the finding (usually all worker node pools should have rotation enabled).

2. Edit the node pool to enable kubelet certificate auto‑rotation

You must do this for each node pool that does not have auto‑rotation enabled.
  1. In the Node Pools tab, click the name of the node pool you want to fix.
  2. On the node pool details page, click Edit (or Update Node Pool).
  3. In the edit form, look for a setting similar to:
    • Kubelet certificate rotation
    • or Auto-rotate kubelet certificates
  4. Enable this setting by checking the box or setting the toggle to On / Enabled.
  5. Review other configuration fields to ensure nothing else is unintentionally changed.
  6. Click Save changes / Update.
OCI will apply the updated configuration to the node pool. Depending on version and settings, nodes may be recreated or drained/updated, so plan to do this during a maintenance window if you have strict availability requirements.

3. Repeat for all node pools in the cluster

  1. Go back to the Node Pools list for the cluster.
  2. Repeat the “Edit node pool” steps for every remaining node pool that does not have kubelet certificate rotation enabled.

4. Verify that kubelet certificate rotation is enabled

  1. After updates complete, return to each Node Pool details page.
  2. Confirm that the Kubelet certificate rotation (or similarly named) field is shown as Enabled.
  3. Optionally, validate from a node:
    • SSH or use kubectl debug to access a node.
    • Check kubelet configuration (e.g., kubelet service or config file) to verify certificate rotation flags are present (implementation detail; optional for compliance).

5. Re-scan / re-run compliance check

After the configuration is updated and node pools finish updating:
  1. Trigger a new scan in your security/compliance tool (Cloud Guard, third‑party CSPM, etc.).
  2. Confirm that the finding “OCI OKE Kubelet Server Certificates Should Be Auto-Rotated” is now marked as resolved for that cluster/node pool.
For OKE today, kubelet server certificate rotation is controlled at the cluster level by the “Auto-Rotate Kubernetes Certificates” setting. As of the latest OKE / OCI CLI versions, that specific toggle is only exposed in the Console and REST API, not as a dedicated boolean flag in oci ce cluster update.So you cannot (yet) flip just that setting with a simple oci ce ... --is-auto-rotate-... style flag. You have two realistic options:

1. Use the OKE API via oci raw-request (CLI wrapper around REST)

This keeps everything in OCI CLI, but calls the underlying Container Engine REST API directly.

1.1. Get cluster details to see current configuration

Inspect cluster-current.json so you can see the current clusterOptions (or similarly named) block and confirm whether there is a field related to Kubernetes certificate rotation (name can vary by release – examples like isKubernetesCertificatesAutoRotationEnabled or similar).

1.2. Build the update payload

Create a minimal JSON file, e.g. cluster-update.json, reusing the current values and only toggling the certificate rotation setting. Do not drop required fields such as name, kubernetesVersion, etc., as the update is usually PATCH-like but still field-sensitive.Example structure (you must match the exact field names from your cluster-current.json):
Replace isKubernetesCertificatesAutoRotationEnabled with the exact property name visible in your current cluster JSON.

1.3. Call the OKE UpdateCluster API via oci raw-request

  1. Get the region and tenancy details (if not set already in your CLI profile):
  2. Call the update API endpoint:
  3. Wait for the work request to finish:
Once completed, kubelet certificates should be on auto-rotation for that cluster.

2. If you can relax the “OCI CLI only” constraint

If strict “CLI only” is not mandatory, the supported and simpler way is:
  1. Go to: Developer Services → Kubernetes Clusters (OKE).
  2. Select the cluster.
  3. Click Edit cluster.
  4. Enable Auto-Rotate Kubernetes Certificates.
  5. Save changes and wait for the update to complete.

Key points for your remediation policy

  • Scope: This is a cluster-level setting affecting kubelet / Kubernetes certificates for nodes in that cluster.
  • Enforcement: For compliance-as-code, wrap the oci raw-request approach in a script or use Terraform/Resource Manager:
    • Ensure all new clusters have certificate auto-rotation enabled.
    • Periodically scan and patch any cluster where the field is false.
If you paste the cluster-current.json (with sensitive OCIDs redacted), I can show you the exact JSON and oci raw-request command specific to your OKE version.
For OKE, kubelet certificate rotation is controlled at the cluster configuration level. The remediation is:
  1. Ensure the cluster has kubelet certificate rotation enabled.
  2. If the current OKE version/SDK supports toggling it on an existing cluster, update the cluster.
  3. If not supported for your cluster version, recreate the cluster with the setting enabled.
Below is how to approach it with the OCI Python SDK.

1. Prerequisites

  • oci Python SDK installed:
  • OCI config file set up (usually ~/.oci/config) with:
    • tenancy
    • user
    • fingerprint
    • key_file
    • region
  • The OCID of the OKE cluster you want to remediate.

2. Inspect SDK Models to Find the Kubelet Config Flag

Because OCI’s API models evolve, you should first introspect which model field is available in your SDK version for kubelet certificate rotation.Run this small helper once in a Python shell:
Look for classes/fields similar to:
  • KubeletConfig
  • UpdateClusterKubeletConfigDetails
  • A boolean named like is_kubelet_certificate_rotation_enabled in any of the *Cluster*Options* models.
Then inspect the candidate model:
You’re looking for a boolean field that clearly enables kubelet certificate rotation, commonly named close to is_kubelet_certificate_rotation_enabled.

3. Example: Updating an Existing Cluster (If Supported)

Below is template code showing the pattern. You must plug in the exact model and field name you discovered in step 2.
If your SDK surfaces the field in a slightly different location/name, adapt:
  • Different model name for options (e.g., ClusterCreateOptions, UpdateClusterOptionsDetails).
  • Direct field on UpdateClusterDetails.

4. If Your OKE/SDK Version Does Not Expose the Flag

If you don’t find any kubelet‑related configuration model/field:
  1. It may be:
    • Already enabled by default for your cluster’s OKE version, or
    • Only configurable at cluster creation time in your region/version.
  2. In that case, the remediation path is:
    • Create a new OKE cluster via the Console or Python SDK, explicitly enabling kubelet certificate rotation during creation (look for the kubelet certificate rotation option in the Console or CreateClusterDetails options in the SDK).
    • Migrate workloads (namespaces, deployments, services) to the new cluster.
    • Decommission the old cluster.
Creation pattern with Python is similar:

If you paste the dir(models) and swagger_types output for the kubelet-related models from your environment, I can give you an exact, concrete Python snippet for your specific SDK version.