Kubernetes
RBAC
security
access control
permissions

Kubernetes RBAC - forbidden attempt to grant extra privileges

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

Introduction

The Kubernetes error about a forbidden attempt to grant extra privileges appears when a user tries to create or update an RBAC object that would give someone permissions they do not already control. In short, Kubernetes prevents privilege escalation by default.

Why Kubernetes Rejects the Request

RBAC resources such as Role, ClusterRole, RoleBinding, and ClusterRoleBinding control permissions in the cluster. Kubernetes checks whether the caller is effectively trying to hand out more power than they already have.

For example, if you can only read pods, you generally cannot create a role that allows deleting secrets. The API server blocks that because it would let you escalate your own authority indirectly.

A simplified role might look like this:

yaml
1apiVersion: rbac.authorization.k8s.io/v1
2kind: Role
3metadata:
4  name: pod-reader
5  namespace: demo
6rules:
7  - apiGroups: [""]
8    resources: ["pods"]
9    verbs: ["get", "list"]

If the caller is not already allowed to grant those permissions, Kubernetes can reject the request with the extra-privileges message.

Bind and Escalate Are Special Cases

Kubernetes has special verbs for RBAC management. Two of the most important are:

  • 'bind'
  • 'escalate'

bind allows a subject to create bindings to roles they would not otherwise be allowed to assign. escalate allows creating or updating roles with permissions beyond the caller's own current rights.

That is why some administrators can manage RBAC broadly while normal operators cannot.

A Common Failure Scenario

Suppose a service account tries to create a ClusterRoleBinding that attaches an admin-style role to itself:

yaml
1apiVersion: rbac.authorization.k8s.io/v1
2kind: ClusterRoleBinding
3metadata:
4  name: give-myself-admin
5subjects:
6  - kind: ServiceAccount
7    name: deployer
8    namespace: demo
9roleRef:
10  apiGroup: rbac.authorization.k8s.io
11  kind: ClusterRole
12  name: cluster-admin

If that service account does not already have the authority to bind cluster-admin, the API server rejects it. That is expected behavior, not a broken cluster.

How to Diagnose It

The first tool to reach for is kubectl auth can-i.

bash
kubectl auth can-i create clusterrolebindings
kubectl auth can-i bind clusterroles
kubectl auth can-i escalate clusterroles

You can also test specific verbs and resources as another subject:

bash
kubectl auth can-i create roles --namespace demo --as system:serviceaccount:demo:deployer

This helps separate two questions:

  1. can the caller create RBAC objects at all
  2. can the caller grant the specific permissions involved

Those are not the same permission check.

Fix the Right Problem

There are only a few legitimate fixes:

  • have a cluster administrator create the role or binding
  • grant the caller the specific bind or escalate capability if that is truly intended
  • reduce the requested permissions so they no longer exceed the caller's authority

The last option is often the safest. Many RBAC failures happen because a manifest was copied from an admin example when the workload only needed a narrow set of verbs.

Avoid Overprivileged RBAC

This error is useful because it stops accidental privilege escalation in CI pipelines and automation accounts. If your deployment job fails here, do not blindly widen permissions. Review what the workload actually needs.

A smaller role is easier to audit:

yaml
1rules:
2  - apiGroups: [""]
3    resources: ["configmaps"]
4    verbs: ["get", "list", "update"]

That is usually better than giving a deployment account broad write access to unrelated resources.

Common Pitfalls

  • Assuming the caller only needs permission to create a role object. Kubernetes also checks whether the caller may grant the permissions inside it.
  • Trying to bind cluster-admin from an ordinary service account.
  • Fixing the error by handing out broad admin rights instead of narrowing the role.
  • Ignoring bind and escalate, which are the key RBAC verbs behind this behavior.
  • Debugging only the manifest and not the identity that is applying it.

Summary

  • The extra-privileges error is Kubernetes preventing RBAC privilege escalation.
  • Creating RBAC objects is not enough; the caller must also be allowed to grant the permissions involved.
  • 'bind and escalate are the special verbs that control broader RBAC delegation.'
  • 'kubectl auth can-i is the fastest way to diagnose the caller's effective authority.'
  • The safest fix is usually narrower RBAC, not broader admin access.

Related reading
Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

All Rights Reserved.