Hardening the kubelet: authentication, authorization and exposed ports

A practical guide to locking down the kubelet on self-managed Kubernetes nodes: anonymous access, webhook authorization, certificate rotation, the read-only port and node-level secret access.

On this page

Why kubelet hardening matters before a node is exposed

Kubelet hardening limits who can call the node agent directly and what a compromised node can read. If your platform or security team runs self-managed nodes and has not yet reviewed kubelet settings, the node agent may be accepting requests in ways nobody chose on purpose. The kubelet is the agent on each node that starts and monitors pods, reports node status and serves its own local API for logs, exec and metrics. That API is separate from the kube-apiserver, so a request that never passes through the control plane can still reach a node. Controls on the API server do not automatically cover it, which is why the kubelet needs its own review.

Teams usually start this work for one of three reasons: an audit or scanner finding that flags the kubelet's authentication or open ports, a new cluster build where node settings are being standardized, or a move to a stricter baseline that the organization has adopted. Each trigger calls for an inventory first. Ask the platform team to list which kubelet authentication and authorization settings are in effect on every node pool, which ports are listening, and whether any node configuration is managed outside the main provisioning tool. Node drift is common in long-lived clusters, so confirm the answer on live nodes, not only in the build templates.

The reason this matters is the node's secrets and identity. A kubelet that can be reached without strong authentication, or that holds credentials broader than its role, gives an attacker a path from one compromised workload or host to the pods and data on that node. Confirm with your cluster distribution's documentation which kubelet flags and configuration files it manages, because the mechanism for changing them differs between kubeadm, RKE2, Talos and other installers. Plan the change as a tested rollout across node pools rather than a single edit, and record the result as evidence for your next review.

Which kubelet settings control who can reach the node agent

The kubelet exposes several network endpoints, and each one answers a different caller: the API server, monitoring tools, and the kubelet's own certificate machinery. The cards below separate those request paths so you can check each one on every node. Confirm exact flag and configuration key names against the kubelet reference for your Kubernetes version before changing anything.

Anonymous authentication

Anonymous authentication decides whether a request with no credentials can reach the kubelet API at all. When it is left on, any host that can reach the kubelet port can call endpoints that list pods and read logs, and some of those calls expose container details an attacker can use to move sideways. Check that anonymous access is disabled in the kubelet configuration on every node, and confirm the setting on nodes that were built before your baseline was applied.

Kubernetes authentication docs

Webhook authentication

Webhook authentication sends bearer tokens presented to the kubelet to the API server's TokenReview endpoint, so the API server decides who the caller is. Without it, the kubelet has no reliable way to tell the API server's own service identity from any other token holder. Confirm that webhook authentication is on, and that the kubelet has the client credentials it needs to call the API server.

Webhook authorization

Webhook authorization sends each authenticated kubelet request to the API server's SubjectAccessReview endpoint, so RBAC decides what the caller may do, such as reading logs, executing into containers or reading stats. If authorization is set to AlwaysAllow, any authenticated caller gets full kubelet access. Confirm the mode is Webhook on each node and that the node identity has only the permissions it needs.

Read-only port

The kubelet has historically offered an unauthenticated read-only port that returns pod and node status without any credentials. Anyone who can reach that port on the node network can map workloads and node details, which is useful reconnaissance for an attacker. Confirm the read-only port is disabled on every node, check whether any monitoring agent still scrapes it, and move that scrape to the authenticated endpoint before you close the port.

Client certificate rotation

Client certificate rotation controls how often the kubelet renews the certificate it uses to authenticate to the API server. Long-lived node credentials stay valid after a compromise or a decommissioned host, so rotation shortens the window in which a copied credential works. Confirm that rotation is enabled, that the kubelet can request renewals on its own, and that your node certificate approval process runs without manual steps that stall renewal.

Serving certificate

The serving certificate is the TLS certificate the kubelet presents to the API server and to other callers on its secure port. A self-signed or unverified serving certificate lets an attacker in the network path impersonate the node, and the API server cannot then confirm it is talking to the real kubelet. Confirm that the serving certificate is issued by a trusted CA or rotated through the kubelet's server certificate request flow, and that the API server validates it.

Where a kubelet request is authenticated and where it is authorized

The diagram starts with an operator client or the API server calling the kubelet API on a node. The kubelet authenticates the caller with a client certificate or bearer token, validating tokens through webhook token authentication against the API server. It then delegates the authorization decision back to the API server through SubjectAccessReview. The dashed paths show what opens when anonymous access or the read-only port is enabled: requests skip both checks and reach node data without a verified identity.

Request path from an API client to the kubelet, with the checks and the unauthenticated paths marked.

Kubelet hardening options and when each fits

This table compares the main kubelet settings by what they change, the risk they address, the cluster conditions that favor them and the checks that confirm them. Read each row as a decision: confirm your current values first, then choose the setting that matches how your nodes and workloads are run.

SettingWhat it changes and risk addressedWhen it fits and how to confirm
Anonymous authenticationControls whether unauthenticated requests to the kubelet API are accepted. Leaving it enabled lets anyone who can reach the node port query node and pod information.Disable in almost all clusters. Confirm the effective value on each node and check that unauthenticated requests to the kubelet port are refused.
Webhook authorizationSends kubelet API requests to the API server for an authorization decision instead of allowing all authenticated callers. Reduces what a valid client certificate can do on the node.Fits clusters where node agents and monitoring tools call the kubelet with certificates. Confirm that a request without the right permission is denied and that the authorization mode is set to webhook.
Client certificate rotationRenews the kubelet's client credential before expiry so that a long-lived credential does not remain valid after a node is compromised or retired.Suits any cluster that runs longer than a short certificate lifetime. Confirm rotation is enabled, that new certificates are issued on the node, and that expiry dates are monitored.
Read-only portExposes an unauthenticated read-only endpoint that reveals node and pod details. It is a common reason for information leakage in older configurations.Close it in every cluster where no tool depends on it. Confirm that the port does not answer from other hosts on the network, and inventory any monitoring that still scrapes it before closing.
Serving certificate handlingDetermines which certificate the kubelet presents on its secure port and whether clients can verify the node. Weak handling enables impersonation of the node endpoint.Use certificates issued by your cluster CA or an approved internal CA where clients verify the node. Confirm the certificate subject names match node addresses and that the chain validates from an admin workstation.
Node-level access to secretsLimits what a process on the node can read from the host and from the kubelet credential, including Secrets mounted into pods. Node compromise can expose data for every pod scheduled there.Matters most in multi-tenant clusters or where sensitive workloads share nodes. Pair node restrictions with least-privilege RBAC and encryption at rest. Confirm with a test pod that it cannot read other namespaces' Secrets through the node.
Node access in the API serverRestricts each kubelet's API permissions to objects tied to its own node, so one compromised node cannot read unrelated pods or Secrets.Fits every cluster that runs more than one node. Confirm that a kubelet credential cannot read objects for other nodes, and record the result as part of your review.

Kubelet hardening steps on a running cluster

This sequence moves each node's kubelet from anonymous, read-only-capable settings to authenticated and authorized access without stopping node registration or workloads. Each step ends with a check you can record before moving to the next node.

  1. Inventory kubelet settings and versions on every node

    Record the Kubernetes version of kube-apiserver, kube-controller-manager, kube-scheduler and every kubelet, then capture the effective kubelet configuration on each node, including the kubelet config file, its drop-in directory and any flags passed through the service unit. Check for anonymous authentication, the webhook authorization mode, the client CA file, certificate rotation settings and the read-only port value. This inventory is the baseline you compare against at the end. Your team or the partner runs it; the output is a per-node table that shows no node has an unexplained difference from the rest of its pool.

  2. Confirm versions against the version skew policy

    Compare the recorded versions with the Kubernetes version skew policy. The policy requires kube-apiserver to be upgraded one minor version at a time, before the other control plane components and kubelets, and allows kubelets to be up to three minor versions older than kube-apiserver. If any node falls outside that range, resolve the upgrade first, because kubelet authentication changes should not be mixed with a version gap. The check is complete when every node is inside the allowed range and the exceptions are written down with an owner.

  3. Test webhook authorization and certificate rotation in a non-production pool

    In a non-production node pool, set the kubelet to use the API server for authentication and webhook authorization, and enable client certificate rotation. Confirm that the node still registers, reports status, receives pods and that logs and exec requests from the API server succeed. Then check the rotation behavior by reviewing certificate expiry before and after the rotation window, and confirm the API server can authorize the kubelet's node identity. The step closes when a test node has stayed Ready through a full scheduling cycle and its certificate reflects the rotation you configured. Confirm the exact flags and feature behavior for your Kubernetes version in the official kubelet documentation before testing.

  4. Disable anonymous access and close the read-only port

    Apply the tested configuration to the test pool first, then set anonymous authentication to disabled and the read-only port to zero in the kubelet configuration. Restart the kubelet on one test node and confirm it re-registers. Any monitoring agent, script or scrape job that depended on unauthenticated kubelet endpoints will fail at this point, so list those consumers and move them to authenticated access before changing production. The step is done when the test node is healthy and no internal consumer still reads the old endpoints.

  5. Roll the change node by node with drain and restart

    Apply the configuration to one production node at a time. Cordon and drain the node, update the kubelet configuration, restart the kubelet, then uncordon the node and wait until it reports Ready and runs its pods again before moving on. Keep a copy of the previous configuration so a rollback is a file restore and a restart. Stop the rollout if any node fails to register, because a broken kubelet change can prevent a node from joining the cluster and can leave pods unscheduled. The step is complete when every node reports Ready with the new configuration.

  6. Verify with requests that must fail and requests that must succeed

    From a host outside the cluster and from a pod, send unauthenticated requests to the kubelet API on port 10250 and to the read-only port, and confirm they are refused. Then send authenticated requests with a permitted identity, such as a monitoring service account, and confirm they succeed only for the endpoints that identity is allowed to use. Check that logs and exec requests from the API server still work. Record each request, its expected result and its actual result. Verification is complete when every expected failure fails and every expected success succeeds, and the record is kept with the change ticket.

How webhook authorization and certificate rotation work together

The key point is that the kubelet authenticates the caller, then hands the authorization decision to the API server. When anonymous access is disabled and webhook authorization is enabled, a request to the kubelet API (such as exec, logs or proxy) is checked by the kubelet against the API server, which evaluates it using RBAC. This makes the API server and its RBAC policy the decision point for node API access. Confirm in your distribution that authentication.anonymous.enabled is false, that authorization.mode is Webhook, and that the kubelet has the credentials it needs to call the API server's SubjectAccessReview endpoint. Then decide which principals, such as the API server's own identity and your monitoring or logging agents, should hold the nodes/proxy, nodes/log or nodes/stats subresource permissions they need, and no more.

Client certificate rotation matters because the kubelet uses its own client credential to reach the API server for everything it does on a node, including reporting status, fetching Pod specs and performing the webhook authorization calls described above. Confirm the certificate lifetimes, where the key pair is stored, and whether the kubelet renews its client certificate automatically (through rotateCertificates) in your distribution, since defaults differ between kubeadm, RKE2, K3s, Talos and managed services. If rotation fails or a certificate expires, the node can drop out of the cluster and show as NotReady, and authorized calls to the kubelet API can fail in ways that look like RBAC errors. Plan a monitoring check on certificate expiry and a runbook for manual renewal before you enable anonymous-access restrictions, so a renewal failure does not also remove your own access to node logs and exec sessions.

Operational risks that follow kubelet configuration changes

Kubelet settings change how nodes authenticate, how monitoring reaches them and how certificates renew. Each risk below appears after a change that looked safe on its own, so the signal to watch and the control to put in place should be decided before the change is rolled out.

Nodes fail to rejoin

Disabling anonymous access or switching to webhook authorization can leave a node unable to report status or receive pod specs if its client certificate or the API server's authorization path is wrong. Watch for nodes stuck in NotReady after the change and for kubelet logs showing 401 or 403 responses. Control it by applying the change to one node first, confirming it registers and goes Ready, and keeping the previous kubelet configuration file available for rollback on that node.

Authentication docs

Monitoring loses anonymous access

Scrapers and log agents that once read kubelet metrics or endpoints without credentials will fail silently after anonymous access is disabled. The signal is a drop to zero in node-level series, such as kubelet metrics, on dashboards that still show green. Control it by inventorying every consumer of kubelet endpoints before the change, then granting each one a dedicated identity with only the permissions it needs and confirming the series return.

Metrics scrapers lose permission

When webhook authorization replaces the default permissive path, the service account used by a metrics scraper needs explicit RBAC rights on node proxy or stats subresources. A scraper that worked yesterday can return authorization errors after the change with no change in its own manifest. Watch scrape error counts in the monitoring system. Control it by testing the scraper's identity with a permission check before the rollout and keeping its RBAC binding under version control.

Kubelet and API server version skew

During a rolling change, nodes may run a different kubelet version from the kube-apiserver. The version skew policy allows kubelets up to three minor versions older than the API server, but only if the control plane is upgraded first, one minor version at a time. Watch the node version column during the rollout. Control it by upgrading kube-apiserver before kubelets and recording the version of every node before starting the rollout.

Version skew policy

Certificate expiry after rotation changes

Changing client certificate rotation settings can alter when kubelet credentials renew, and a rotation that is disabled or fails silently leaves nodes unable to authenticate when the certificate expires. The signal is certificate expiry dates approaching on node credentials with no recent renewal events. Control it by checking the expiry date of each node's kubelet client certificate before and after the change, and alerting well before expiry rather than relying on a single renewal.

Drift from old node templates

New nodes built from an outdated image or provisioning template may start with the previous kubelet flags, anonymous access or the read-only port still enabled. The result is a cluster where hardened and unhardened nodes coexist and the gap is invisible in the control plane. Watch the kubelet configuration of newly joined nodes against the approved baseline. Control it by baking the kubelet configuration into the template, and checking configuration on every new node as part of its join process.

Restricting node-level access to secrets

Kubelet hardening only protects secrets if the cluster also stops them from being readable in the first place. Kubernetes stores Secrets unencrypted in etcd by default, according to the Kubernetes secrets good practices documentation, so anyone who can read etcd files or snapshots can read every Secret in the cluster. Treat the kubelet changes in this topic as one layer of three: encryption at rest for etcd, least-privilege RBAC that limits who can list and watch Secrets, and, where a secret must never sit in the cluster at all, an external store delivered through the Secrets Store CSI Driver. Confirm encryption at rest is enabled and tested on your control plane before you rely on any node-side control.

A compromised node matters because the kubelet on that node receives the Pod specs and the Secrets mounted into the Pods scheduled there. An attacker with root on the node, or with the kubelet's credentials, can read those Secrets from the node's filesystem and from memory, whatever RBAC says about human users. Verify three things for each node pool: who can read Secrets in each namespace, which service accounts and workloads can reach the kubelet API (including through the port you have chosen to keep open), and whether the node's client credentials are scoped to that node rather than shared. Confirm the exact node-level scoping behavior of your Kubernetes version and distribution in its documentation and test it in a staging cluster rather than assuming it.

Decide early which secrets must live only in an external store. Workloads that pull credentials through the Secrets Store CSI Driver still place a copy on the node while the Pod runs, so limit which Pods may mount them and which node pools run them, and review that mapping alongside Pod Security Standards. The Kubernetes Secrets good practices page is the natural reference for building that review. Record the result as a short inventory of Secrets, their readers and their storage location, because that inventory is what an auditor or incident responder will ask for first.

What to confirm in your environment before changing kubelet flags

Kubelet changes look small in a diff but reach every node and every tool that talks to it. The cards below are questions to answer with your platform, installer and operations teams before you touch authentication, authorization or ports.

Kubernetes and kubelet versions

Confirm the exact kube-apiserver and kubelet minor versions on every node pool. The kubelet may be up to three minor versions older than the API server, so a mixed fleet can behave differently from one you tested. Check whether the flags you plan to change still exist, are deprecated or moved into a kubelet configuration file in your version. Record the versions in the change ticket so the rollback target is clear.

Authentication docs

Distribution and kubelet configuration ownership

Ask how your distribution sets kubelet arguments and where the configuration lives, such as a kubelet config file, systemd drop-in or generated node bootstrap settings. Some distributions manage these through their own resources, and a manual edit may be reverted on the next reconcile. Identify who owns that file and whether the change belongs in the distribution's supported override mechanism.

Installer and image pipeline overwrites

Find out whether nodes are rebuilt from an image, provisioned by an installer or reimaged during patching. If the kubelet settings come from a template, a node rebuild or scale-out can restore anonymous access or the read-only port without any alert. Confirm that your pipeline carries the hardened settings and that new nodes join with the same configuration as existing ones.

Monitoring and backup tools calling the kubelet

List every tool that reads from the kubelet, including metrics scrapers, log collectors, node exporters, backup agents and troubleshooting scripts. Some of these call the kubelet API with anonymous requests or the read-only port, and a change to authentication or port exposure can silently stop their data. Test each one against a single node before rolling the change across the fleet.

Audit or benchmark target

Confirm whether an audit finding, internal baseline or the CIS Kubernetes Benchmark defines the required kubelet state. The benchmark covers upstream Kubernetes and several managed services, and its recommendations for kubelet authentication and authorization map to the settings you plan to change. Agree on which recommendations you will adopt, which you will document as exceptions and who signs off on each.

CIS Kubernetes Benchmark

Air-gapped image sources and change windows

Ask whether nodes can reach the internet to fetch images, packages or distribution updates. In an air-gapped environment, a fix that requires a new kubelet build, a new configuration bundle or a replacement image must go through your internal registry and mirror first, which lengthens the change window. Confirm the registry path, the approval steps and how long a rollback package stays available.

Questions teams ask before hardening kubelets

How much does kubelet hardening cost?

Cost depends on the work scope, not a single rate, so no figure is given here. Kubelet hardening is usually a bounded change on each node, but the total depends on how many nodes you run, how many distributions or node pools differ, how many monitoring and logging integrations read kubelet metrics or endpoints, and how much change control your organization requires. Recurring costs appear later through certificate rotation checks and upgrade retesting. Ask for a written scope that lists node groups, environments, the integrations to verify and the deliverables, then compare quotes against that same list.

How long does a kubelet rollout take on a multi-node cluster?

The duration depends on node count, how many node pools exist and how much change control applies to each one. Nodes are usually changed in batches, with each batch drained, reconfigured, restarted and checked before the next one starts. Teams that test first in a non-production cluster that matches production node images and distribution settings can shorten the production window, but that test environment has its own setup time. Ask for a timeline that separates test, pilot batch, full rollout and rollback steps, and confirm which change windows your organization must respect.

What does the work need from our own team?

Expect to provide access, approvals and people who know your environment. Your platform team needs to confirm how kubelets are started (systemd drop-ins, distribution-managed configuration or node image settings), which kubelet flags and configuration files are in use, and which components call the kubelet API. Security or compliance staff should sign off on the target configuration and evidence. Your monitoring owners need to confirm which scrapes or health checks depend on anonymous or read-only access before those paths change. Request a list of these dependencies in the written scope.

Can our internal team harden kubelets without outside help?

Yes, if the team has node administration experience, can test changes outside production and can verify API server authorization behavior. The main risks are misconfigured authentication that locks out components, and forgotten consumers of the read-only port or anonymous access. Kubelet settings are documented in the Kubernetes reference, and the CIS Kubernetes Benchmark gives a consensus configuration baseline you can map against. An outside partner adds value mainly when the team lacks time, test capacity or independent review.

Will kubelet hardening break running workloads?

It can, if a component depends on the settings being changed. Workloads themselves usually use the Kubernetes API rather than the kubelet directly, so the most common breakage comes from monitoring agents, log collectors, debugging tools and custom scripts that scrape kubelet endpoints without credentials. Restarting kubelets also reschedules or disrupts pods on each node if drains are skipped. Confirm which endpoints each consumer uses, run the change in a test cluster first, and keep a documented rollback for each node group.

How does kubelet hardening fit with CIS benchmark findings?

Kubelet configuration is one area the CIS Kubernetes Benchmark covers, and its recommendations are grouped by component and by control ID. A benchmark scan often flags anonymous authentication, webhook authorization and read-only port settings on nodes, so kubelet work can close several findings at once. Some findings depend on other areas such as RBAC, audit logging or secrets encryption, which you handle separately. Ask for a written mapping from each in-scope benchmark control ID to the change, the evidence and the owner, and check whether your distribution already sets some values.

What should we request in a written scope for kubelet hardening?

A useful scope names the environments, node groups, distributions and Kubernetes versions covered, along with the authentication, authorization, certificate rotation and port settings to change. It should list monitoring and logging integrations to test, the secrets access review to perform, the test and production sequence and the rollback plan. Ask for deliverables such as a configuration baseline, change records, verification results and an operations handover. Also confirm what is excluded, since upgrades, CNI work and broader policy controls are often separate engagements.

How DeployOpen scopes and delivers kubelet hardening

DeployOpen plans and applies kubelet hardening on Kubernetes clusters that run in infrastructure you control. The work starts from your current node configuration and ends with tested settings, documentation and a handover your platform team can operate.

How we scope

  • We inventory each node pool's kubelet configuration, distribution and kubelet version before proposing any change.
  • We agree in writing which anonymous access, webhook authorization, port and certificate settings are in scope.
  • We confirm which workloads, monitoring agents and admin tools call the kubelet API so breakage is planned, not discovered.
  • Engagements are fixed-scope, with deliverables and timelines agreed before work starts.

How we build

  • We stage changes on non-production node pools first, using the same distribution and version as production.
  • We set anonymous authentication off, switch authorization to webhook mode, and close the read-only port.
  • We verify client certificate rotation and restrict node-level access to Secrets, checking the results against the API server.
  • We test each change for expected denials and for normal kubelet operations such as logs, exec and metrics scraping.

How we hand over

  • You receive the final kubelet configuration per node pool, with each setting explained and its reason recorded.
  • You receive verification results showing the before and after state for authentication, authorization and exposed ports.
  • You receive a rollout runbook covering node-by-node changes, rollback steps and how to add new node pools safely.

How we support

  • Retesting after kubelet upgrades or distribution changes can be included in the written scope.
  • Ongoing support, upgrades and continuous testing are available as a retainer, if your team wants us to keep the settings current.
  • Questions about your specific distribution's defaults are confirmed with its documentation during scoping, not assumed.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.