Kubernetes RBAC Privilege Escalation

Critical Risk Container Security
kubernetesrbacprivilege-escalationcluster-securityaccess-controlservice-accounts

What it is

Misconfigured Kubernetes Role-Based Access Control (RBAC) that allows users or service accounts to escalate privileges and gain unauthorized access to cluster resources. This includes overly permissive roles, wildcard permissions, and improper binding configurations that violate the principle of least privilege.

â„šī¸ Configuration Fix

Configuration changes required - see explanation below.

💡 Explanation

â„šī¸ Configuration Fix

Configuration changes required - see explanation below.

💡 Explanation

â„šī¸ Configuration Fix

Configuration changes required - see explanation below.

💡 Explanation

â„šī¸ Configuration Fix

Configuration changes required - see explanation below.

💡 Explanation

â„šī¸ Configuration Fix

Configuration changes required - see explanation below.

💡 Explanation

â„šī¸ Configuration Fix

Configuration changes required - see explanation below.

💡 Explanation

â„šī¸ Configuration Fix

Configuration changes required - see explanation below.

💡 Explanation

â„šī¸ Configuration Fix

Configuration changes required - see explanation below.

💡 Explanation

Why it happens

Using wildcard (*) permissions in RBAC roles, granting excessive access to all resources or verbs within a namespace or cluster

Root causes

Wildcard Permissions

Using wildcard (*) permissions in RBAC roles, granting excessive access to all resources or verbs within a namespace or cluster

Over-Privileged Service Accounts

Binding service accounts to cluster-admin or other high-privilege roles without proper justification or scope limitation

Transitive Permission Escalation

Granting permissions that allow users to modify RBAC resources, enabling them to grant themselves additional privileges

Default or Generic Role Bindings

Using default system roles or creating generic roles that are overly broad and applied across multiple namespaces or users

Fixes

1

Implement Least Privilege RBAC

Create specific roles with minimal required permissions, avoiding wildcards and granting only necessary access to specific resources and verbs

2

Use Namespace-Scoped Roles

Prefer RoleBindings over ClusterRoleBindings when possible, limiting permissions to specific namespaces rather than cluster-wide access

3

Regular RBAC Audits

Implement automated tools and processes to regularly audit RBAC configurations and identify overly permissive roles or unused permissions

4

Service Account Segregation

Create dedicated service accounts for specific applications with minimal required permissions rather than using default or shared accounts

Detect This Vulnerability in Your Code

Sourcery automatically identifies kubernetes rbac privilege escalation and many other security issues in your codebase.