Check ID:
Provider: Kubernetes
Service:
Severity: HIGH
Categories:
Resource type:
apiserver_no_token_auth_fileProvider: Kubernetes
Service:
apiserverSeverity: HIGH
Categories:
cluster-security, identity-accessResource type:
PodWhat this check verifies
Kubernetes API server configuration is reviewed for use of static token file authentication by inspecting API server containers for the--token-auth-file argument
Risk
Using static bearer tokens undermines CIA:- Confidentiality: leaked tokens grant API access
- Integrity: long-lived tokens enable unauthorized changes
- Availability: access can’t be revoked quickly Tokens are clear-text and lack revocation/rotation, enabling persistent access if exposed.
Recommendation
Avoid static token files. Prefer client certificates, OIDC/webhook authenticators, or service accounts with short-lived tokens. Apply least privilege with RBAC, enforce rotation and short expirations, and disable--token-auth-file to support defense in depth and rapid credential revocation.
Remediation
Dashboard steps- SSH to each control plane node
- Open /etc/kubernetes/manifests/kube-apiserver.yaml
- In spec.containers[0].command, remove the line containing: —token-auth-file=</path/to/file>
- Save the file; the kubelet will automatically restart the API server
- Repeat on all control plane nodes
- Verify the flag is absent: kubectl -n kube-system get pods -l component=kube-apiserver -o yaml | grep — —token-auth-file || echo “not present”
References
Where this check fires
This check runs on every scheduled scan against your Kubernetes account. Findings appear at Cloud Security → Findings filterable byCheck ID = apiserver_no_token_auth_file. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to Kubernetes checks