Skip to main content

More Info:

Kubernetes provides the option to use client certificates for user authentication. However as there is no way to revoke these certificates when a user leaves an organization or loses their credential, they are not suitable for this purpose. It is not possible to fully disable client certificate use within a cluster as it is used for component to component authentication.

Risk Level

Low

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. Identify all client-certificate-based user configs on admin machines (evidence gathering)
    • On any machine with kubectl access, search typical kubeconfig locations for client-certificate auth (non-service-account):
    • For each kubeconfig found, list users and auth methods:
    • Decision: treat any context where user has client-certificate/client-certificate-data and is used by a human admin/script (not a core control-plane component) as non-compliant.
  2. Confirm which client-cert identities have cluster privileges
    • On any machine with kubectl access, list ClusterRoleBindings/RoleBindings that reference User subjects (these may be backed by client certs):
    • For each User subject, note whether that identity corresponds to a client certificate user from kubeconfig.
    • Decision: if such users are humans or automation that could instead use OIDC or another revocable mechanism, mark them for migration.
  3. Design and enable an alternative auth mechanism (e.g., OIDC) on every control plane node
    • On every control plane node, review the current API server flags to see if OIDC (or another centralized identity provider) is already configured:
    • If OIDC is not enabled, follow your organization’s identity design to add the appropriate --oidc-* flags (issuer-url, client-id, etc.) to the kube-apiserver manifest, usually at:
      /etc/kubernetes/manifests/kube-apiserver.yaml
      • Editing this static pod manifest will restart the API server on that node.
    • Decision: only proceed once a revocable and centrally managed authentication method is configured and tested.
  4. Migrate human and automation users from client certs to OIDC (or chosen mechanism)
    • On any machine with kubectl access, for each non-compliant user:
      1. Create or identify the corresponding OIDC identity (subject/claim) in your IdP.
      2. Create/update Kubernetes RoleBinding/ClusterRoleBinding to grant the same roles to the new User/Group as identified by OIDC claims. Example (adapt to your IdP and roles):
    • Update kubeconfig used by each human/automation to use OIDC auth (e.g., via an exec plugin or cloud CLI) instead of client certificate fields.
  5. Remove or de-privilege client-certificate users once migration is confirmed
    • On any machine with kubectl access, after verifying affected users can authenticate and operate via OIDC:
      • Remove or adjust RBAC bindings that reference the old client-cert User identities:
      • Optionally, revoke or delete the issuing CA or intermediate used solely for those user client certs in your PKI system (outside the cluster), ensuring it does not impact component-to-component certs.
    • On admin machines, clean up outdated kubeconfigs that still contain client-certificate for humans or automation:
  6. Verify that client certificate authentication is no longer used for users (only components)
    • On any machine with kubectl access, re-check kubeconfigs:
      Ensure only control-plane/component configs (e.g., kube-apiserver, kube-controller-manager, kube-scheduler, kubelet) use client certs.
    • Confirm RBAC no longer grants roles to user identities that are only accessible via client certs by re-running:
      and ensuring any remaining User subjects correspond only to component identities or identities authenticated via your new mechanism.
kubectl cannot modify client certificate authentication for users because this is controlled by host-level configuration and API server flags on every control plane node. Make the necessary changes directly on those nodes as described in the Manual Steps section.