| name | cis-k8s-v1111-5.1.5 |
| description | Ensure that default service accounts are not actively used (Manual) |
| category | cis-k8s |
| version | 1.11.1 |
| author | cyberstrike-official |
| tags | ["cis","kubernetes","policies","rbac","service-accounts","token-creation"] |
| cis_id | 5.1.5 |
| cis_benchmark | CIS Kubernetes Benchmark v1.11.1 |
| tech_stack | ["kubernetes"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
5.1.5 Ensure that default service accounts are not actively used (Manual)
Profile Applicability
Description
The default service account should not be used to ensure that rights granted to applications can be more easily audited and reviewed.
Rationale
Kubernetes provides a default service account which is used by cluster workloads where no specific service account is assigned to the pod. Where access to the Kubernetes API from a pod is required, a specific service account should be created for that pod, and rights granted to that service account. The default service account should be configured to ensure that it does not automatically provide a service account token, and it must not have any non-default role bindings or custom role assignments.
Impact
All workloads which require access to the Kubernetes API will require an explicit service account to be created.
Audit
For each namespace in the cluster, review the rights assigned to the default service account and ensure that it has no roles or cluster roles bound to it apart from the defaults. Additionally ensure that the automountServiceAccountToken: false setting is in place for each default service account.
Remediation
Create explicit service accounts wherever a Kubernetes workload requires specific access to the Kubernetes API server. Modify the configuration of each default service account to include this value:
automountServiceAccountToken: false
Default Value
By default the default service account allows for its service account token to be mounted in pods in its namespace.
References
- https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
CIS Controls
| Controls Version | Control | IG 1 | IG 2 | IG 3 |
|---|
| v8 | 5.3 Disable Dormant Accounts | X | X | X |
| v7 | 16.9 Disable Dormant Accounts | X | X | X |