Check ID:
Provider: Kubernetes
Service:
Severity: HIGH
Categories:
Resource type:
apiserver_service_account_key_file_setProvider: Kubernetes
Service:
apiserverSeverity: HIGH
Categories:
cluster-security, identity-accessResource type:
PodWhat this check verifies
Kubernetes API server uses--service-account-key-file to supply the public key(s) for validating service account tokens.
Detection looks for API server containers that lack this flag.
Risk
Without a dedicated key file, token validation can fall back to the API server’s TLS key, eroding separation of duties. Compromise or rotation of that key can enable token forgery (confidentiality/integrity) or invalidate tokens, disrupting workloads (availability).Recommendation
Use a dedicated key pair for service accounts:- Configure
--service-account-key-filewith public keys for validation - Keep signing and serving keys separate (least privilege)
- Enforce scheduled key rotation and maintain multiple active keys for defense in depth
Remediation
Dashboard steps- SSH to the control plane node.
- Edit the API server static pod manifest: sudo vi /etc/kubernetes/manifests/kube-apiserver.yaml
- In spec.containers[0].command add this line:
- Save the file; the kubelet will restart the API server automatically.
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_service_account_key_file_set. 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