keepcalculator

06 Numbers and Powers

Unauthenticated Admin Access: Kubernetes Security

Card No. 06·16252 · Updated · Standard formula, shown below

Severity score 96
Risk level (1-10)
8
You entered
Exposure (hours)
24 h
You entered
Workloads affected
50 count
You entered
You enter
Risk level (1-10), Exposure (hours), Workloads affected
You get
Severity score
Rounding
0 dp

Unauthenticated admin access to a Kubernetes cluster means that any user who can reach the API server can perform administrative actions without providing credentials, effectively giving them full control over the cluster and everything running on it. This is a critical security vulnerability because it allows an attacker to deploy malicious workloads, steal secrets, and pivot to other systems connected to the cluster. In this article, we explain what this access looks like, how it happens, why it is so dangerous, and how to prevent it.

What Is Unauthenticated Admin Access?

In Kubernetes, the API server is the front door to the cluster. Every command you run with kubectl, every controller action, and every service account request goes through the API server. Authentication verifies who you are, and authorization decides what you can do. Unauthenticated admin access means that the API server does not require any proof of identity (no token, no certificate, no username/password) and that the anonymous user is granted cluster-admin privileges. This is the most severe misconfiguration possible, because it combines two failures: authentication is disabled or misconfigured, and the default role binding grants administrative rights to the anonymous group.

How Does It Happen?

Most often, this happens during cluster setup or testing. A developer or administrator wants to quickly test a feature and starts the API server with the --insecure-port=8080 flag (deprecated and removed in newer versions) or binds the secure port to 0.0.0.0 without setting up certificates. In other cases, a cluster is deployed with a default configuration that includes a ClusterRoleBinding granting cluster-admin to the system:anonymous user. This can occur when using certain installation scripts or when copying configuration from an insecure example. A less common but real scenario is a misconfigured authentication webhook that returns “allowed” for every request, effectively treating all users as authenticated.

Why Is It So Dangerous?

With admin access, an attacker can do anything a legitimate administrator can do. This includes:

  • Creating or deleting pods, deployments, and namespaces
  • Reading secrets, configmaps, and service account tokens
  • Modifying network policies and exposing services to the internet
  • Executing commands inside running containers (kubectl exec)
  • Installing malicious controllers or webhooks that persist after the initial access is closed
  • Accessing the underlying node via hostPath mounts or privileged containers

The impact is not limited to the cluster itself. Kubernetes clusters often have access to cloud provider APIs, databases, and other internal services. Once an attacker has admin access, they can use the cluster as a launchpad for further attacks, such as stealing cloud credentials from the metadata service or moving laterally to other systems.

How to Detect It

Detecting unauthenticated admin access requires auditing the cluster configuration and monitoring API server logs. The first step is to check the API server flags and the authentication configuration. You can do this by inspecting the API server pod spec or the kube-apiserver process arguments. Look for --insecure-port (should not be present) and --anonymous-auth=false (should be set to false, or at least not explicitly true). Next, review all ClusterRoleBindings and RoleBindings for subjects that include system:anonymous or system:unauthenticated. A quick command to list these is:

kubectl get clusterrolebindings -o json | jq '.items[] | select(.subjects[]?.name | contains("anonymous"))'

Also, check the API server audit logs for requests from user system:anonymous with verbs like create, delete, or update. If you find any, that is a red flag. Finally, use a security scanner like kube-bench or kube-hunter, which can automatically check for this misconfiguration.

How to Fix It

If you find unauthenticated admin access, act immediately. Here is a step-by-step approach:

  1. Disable anonymous access: Set --anonymous-auth=false on the API server. This will block all requests that do not present valid credentials.
  2. Remove insecure port: Ensure the API server is not listening on port 8080. Modern Kubernetes versions do not support this flag, but if you are on an older version, remove it.
  3. Remove dangerous bindings: Delete any ClusterRoleBinding or RoleBinding that grants cluster-admin to system:anonymous or system:unauthenticated.
  4. Restart API server: After making changes, restart the API server to apply the new configuration.
  5. Rotate credentials: If you suspect the cluster was accessed, rotate all service account tokens, kubeconfig files, and any other secrets that were stored in the cluster.
  6. Audit for damage: Look for unexpected workloads, modified RBAC policies, or new users. Use the audit logs to trace what the anonymous user did.

Prevention Best Practices

Preventing this issue is much easier than fixing it. Follow these practices:

  • Always use TLS for the API server and never expose it to the public internet unless absolutely necessary.
  • Use a managed Kubernetes service (EKS, GKE, AKS) which enforces secure defaults.
  • Implement RBAC with the principle of least privilege. Do not grant cluster-admin to anyone unless it is truly required.
  • Enable audit logging and monitor for suspicious activity.
  • Use network policies to restrict access to the API server from within the cluster.
  • Regularly run security scans and penetration tests.

Common Misconceptions

A common misconception is that unauthenticated access only matters if the cluster is publicly reachable. In reality, an attacker who has already compromised a pod inside the cluster can reach the API server from within the cluster network. Many clusters have a service account token mounted into every pod by default, but if the API server accepts anonymous requests, the attacker does not even need that token. Another misconception is that the --insecure-port flag is harmless because it only binds to localhost. In some older versions, it could be bound to all interfaces, and even if it is localhost, an attacker who gains access to the node can use it. The safest approach is to disable it entirely.

Frequently Asked Questions

What is the difference between unauthenticated and anonymous access?

Anonymous access is a Kubernetes feature that allows requests without credentials to be treated as the system:anonymous user. Unauthenticated access means the API server does not require any authentication at all. In practice, they are the same: the API server accepts requests without verifying identity. The risk depends on what permissions the anonymous user has. If anonymous access is enabled but the anonymous user has no permissions, it is not dangerous. The danger comes when anonymous users are granted admin rights.

Can I test if my cluster is vulnerable without breaking anything?

Yes, you can run a non-destructive test. Use curl to send a request to the API server without any credentials. For example, curl https://<api-server>:6443/api/v1/namespaces. If you get a list of namespaces, then anonymous access is enabled and you have at least read permissions. If you get a 403 Forbidden, then anonymous access is either disabled or has no permissions. To test for admin access, you could try to create a dummy resource, but that is risky. Instead, check the RBAC bindings as described earlier.

What is the impact of unauthenticated admin access on a production cluster?

It is catastrophic. An attacker can steal all secrets, including database credentials, API keys, and service account tokens. They can deploy cryptocurrency miners, ransomware, or backdoors. They can also delete data or disrupt services, causing downtime and financial loss. In many cases, the attacker can also access the cloud provider account through the node’s IAM role, leading to a full account compromise.

How does this compare to a misconfigured cloud storage bucket?

Both are similar in that they expose sensitive data or resources to anyone who knows the URL or IP. However, a Kubernetes cluster is far more powerful because it gives the attacker the ability to run arbitrary code, not just read or write files. A compromised cluster can be used to attack other systems, making it a much higher-value target.

Can unauthenticated admin access be introduced by a third-party application?

Yes, if a third-party application or chart creates a ClusterRoleBinding that grants admin to the anonymous user. This is rare but has happened in the past with poorly designed Helm charts. Always review the RBAC resources that a chart creates before installing it. Use tools like kube-score or polaris to scan charts for security issues.

What is the first thing to do after discovering unauthenticated admin access?

Immediately revoke the access by disabling anonymous authentication and removing any dangerous bindings. Then, assume the cluster is compromised and rotate all secrets and credentials. Do not wait to investigate first; stop the bleeding first, then investigate the scope of the breach.

Related

Formula used
in risk | Risk level (1-10) | - | 8 | 1 | 10
in exposure | Exposure (hours) | h | 24 | 0 | 8760
in workloads | Workloads affected | count | 50 | 1 | 10000
out severity | Severity score | - | (risk * exposure * workloads) / 100 | 0

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →