Anonymous authentication is not disabled

Restrict unnecessary anonymous authentication and permissions to protect API and node access.

Description

With anonymous authentication enabled, a request without credentials can reach authorization as an anonymous user.

Potential impact

Anyone can read API or node information that the applicable authorization policy grants to that user.

Remediation

If anonymous access is unnecessary, check the active configuration. Use --anonymous-auth=false for a flag-configured API server and authentication.anonymous.enabled: false in the kubelet configuration. If a health check needs anonymous access, use AuthenticationConfiguration on a supported API server to allow anonymous authentication only on the required paths. Limit access separately through an authorizer such as RBAC and test the health check.

Examples

The excerpts compare Kubernetes 1.6 API server flags. Use your cluster’s version and verify its authentication, authorization and network settings.

Before

yaml
apiVersion: v1
kind: Pod
metadata:
  name: command-demo
spec:
  containers:
    - name: command-demo-container
      image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0
      command: ["kube-apiserver", "--anonymous-auth=true"]

After

yaml
apiVersion: v1
kind: Pod
metadata:
  name: command-demo
spec:
  containers:
    - name: command-demo-container
      image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0
      command: ["kube-apiserver", "--anonymous-auth=false"]

The second excerpt disables anonymous authentication. Confirm the protected API rejects a request without credentials.

References