Kubernetes RBAC Misconfiguration
Kubernetes RBAC Misconfiguration 是什么?
Kubernetes RBAC MisconfigurationOver-permissive Kubernetes Role/ClusterRole bindings that grant workloads, users, or service accounts cluster-wide powers — verbs on Secrets, pods/exec, impersonate — turning a single compromised container into cluster takeover.
Kubernetes RBAC misconfiguration is consistently in the top three findings of every cluster audit. The common patterns are: binding workloads to cluster-admin or to ClusterRoles with verbs `*` on resources `*`; granting `get`, `list`, or `watch` on `secrets` cluster-wide (which lets a pod read every secret in the cluster); allowing `pods/exec` (which lets the holder shell into any pod, including the API server's static pods on misconfigured clusters); allowing `impersonate` on users, groups, or serviceaccounts (which is full account takeover); and binding the default service account in `kube-system` to admin. The blast radius pattern is consistent: a compromised front-door container with one of these bindings allows an attacker to dump all Secrets (including service-account tokens), exec into other pods, modify webhooks, or impersonate the admin group. Mitigations include automated linting (kubescape, kube-bench, Polaris, Datree), admission policies (Kyverno, OPA Gatekeeper) that reject overpermissive bindings, periodic generation of a least-privilege Role from runtime audit logs (rakkess, audit2rbac), and rolling out Pod Identity / Workload Identity rather than cluster-wide tokens.
● 示例
- 01
A monitoring sidecar is bound to a ClusterRole granting `get` on `secrets` cluster-wide; a compromise of the sidecar lets the attacker dump every Secret in every namespace.
- 02
An admission policy rejects any RoleBinding that references the `cluster-admin` ClusterRole outside of the `kube-system` namespace.
● 常见问题
Kubernetes RBAC Misconfiguration 是什么?
Over-permissive Kubernetes Role/ClusterRole bindings that grant workloads, users, or service accounts cluster-wide powers — verbs on Secrets, pods/exec, impersonate — turning a single compromised container into cluster takeover. 它属于网络安全的 云安全 分类。
Kubernetes RBAC Misconfiguration 是什么意思?
Over-permissive Kubernetes Role/ClusterRole bindings that grant workloads, users, or service accounts cluster-wide powers — verbs on Secrets, pods/exec, impersonate — turning a single compromised container into cluster takeover.
Kubernetes RBAC Misconfiguration 是如何工作的?
Kubernetes RBAC misconfiguration is consistently in the top three findings of every cluster audit. The common patterns are: binding workloads to cluster-admin or to ClusterRoles with verbs `*` on resources `*`; granting `get`, `list`, or `watch` on `secrets` cluster-wide (which lets a pod read every secret in the cluster); allowing `pods/exec` (which lets the holder shell into any pod, including the API server's static pods on misconfigured clusters); allowing `impersonate` on users, groups, or serviceaccounts (which is full account takeover); and binding the default service account in `kube-system` to admin. The blast radius pattern is consistent: a compromised front-door container with one of these bindings allows an attacker to dump all Secrets (including service-account tokens), exec into other pods, modify webhooks, or impersonate the admin group. Mitigations include automated linting (kubescape, kube-bench, Polaris, Datree), admission policies (Kyverno, OPA Gatekeeper) that reject overpermissive bindings, periodic generation of a least-privilege Role from runtime audit logs (rakkess, audit2rbac), and rolling out Pod Identity / Workload Identity rather than cluster-wide tokens.
如何防御 Kubernetes RBAC Misconfiguration?
针对 Kubernetes RBAC Misconfiguration 的防御通常结合技术控制与运营实践,详见上方完整定义。
Kubernetes RBAC Misconfiguration 还有哪些其他名称?
常见的别称包括: K8s RBAC misuse, Overprivileged ServiceAccount。
● 相关术语
- cloud-security№ 671
Kubernetes 安全
对 Kubernetes 集群(API Server、控制平面、节点、工作负载与网络)的保护,防止配置错误、被攻陷以及横向移动。
- cloud-security№ 668
Kubernetes 集群攻击
针对 Kubernetes(K8s)集群的入侵,利用暴露的 API、薄弱的 RBAC 或脆弱的工作负载来控制控制平面或工作节点。
- identity-access№ 955
最小权限原则
一种安全原则,要求向每个用户、进程或服务仅授予其完成职责所必需的最少权限,绝不多余。
- cloud-security№ 1124
服务账户令牌(Service Account Token)
挂载在 Kubernetes Pod 中的 JWT 凭据,用于让工作负载向 API Server 以及信任集群身份提供方的其他服务进行认证。
- cloud-security№ 849
OPA Gatekeeper
OPA Gatekeeper 是 CNCF 的策略控制器,基于 Open Policy Agent 与 Rego 语言,在 Kubernetes 上执行准入与审计策略。
- cloud-security№ 673
Kyverno
Kyverno 是 CNCF 的 Kubernetes 策略引擎,使用原生 YAML(而非新 DSL)编写策略,实现资源的校验、变更与生成。