Join our Newsletter — 33% off our NHI Course
Home› Guides› Kubernetes impersonate Verb: What It Allows and How…
Guide Cloud & Workload Identity

Kubernetes impersonate Verb: What It Allows and How to Restrict and Detect It

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 11 min read
On this page

A subject that holds the Kubernetes impersonate verb can act as any user, group or service account it is allowed to name, and inherits everything that identity can do. Impersonation is a legitimate feature used by administrators, access proxies and platform controllers, yet a single broad grant quietly turns a low-privilege account into a path to cluster-admin. This guide explains how impersonation is processed by the API server, how to scope it with resourceNames and the newer constrained impersonation verbs, and how to find and audit impersonated requests. It is written for Kubernetes platform and security engineers who own RBAC and audit policy. It builds on the Kubernetes RBAC Guide and goes deeper on this one verb.

Key takeaways

  • Impersonation swaps the identity before authorisation. The API server authenticates the caller, checks the impersonate permission, then evaluates the request entirely as the impersonated user.
  • The classic verb is all or nothing. Permission to impersonate an identity grants every action that identity can perform, across all namespaces, so it must be treated like holding that identity's credentials.
  • Always pin resourceNames. A rule on users, groups or serviceaccounts without named values lets the holder become anyone, including members of system:masters.
  • Constrained impersonation narrows the action as well as the identity. The impersonate:<mode> and impersonate-on:<mode>:<verb> verbs, beta and on by default from Kubernetes v1.36, let you allow only specific operations while impersonating.
  • Every impersonated request is auditable. Audit events carry both user and impersonatedUser, which makes impersonation one of the easier privilege paths to monitor if an audit policy is in place.

How impersonation works

The Kubernetes documentation describes impersonation as a way for an authenticated user to act as another user, group or service account through HTTP headers. The request passes through five steps: the client sends its own credentials plus impersonation headers, the API server authenticates the real caller, it checks that the caller holds impersonation privileges for each value supplied, it replaces the request's user information with the impersonated values, and authorisation then runs against the impersonated identity only. Audit records the original caller alongside the substituted identity.

HeaderPurposekubectl flagNotes from the docs
Impersonate-UserUsername to act as--asRequired for all other impersonation headers
Impersonate-GroupGroup to act as; may be repeated--as-groupOptional; requires Impersonate-User
Impersonate-UidUnique identifier for the impersonated user--as-uid (kubectl 1.23)Available from API server 1.22; no format imposed
Impersonate-Extra-<name>Extra user attributes, such as scopes--as-user-extra (kubectl 1.35)Name must be lower case; non-legal header characters percent-encoded

Service accounts are impersonated by username, in the form system:serviceaccount:<namespace>:<name>, and nodes as system:node:<name>. The SelfSubjectReview API (kubectl auth whoami) returns the impersonated identity when called with impersonation headers, which is useful for confirming what a proxy is actually sending.

The impersonate verb in RBAC

To set a header, the caller needs the impersonate verb on the matching resource. The resources live in two API groups, and missing the second group is a common reason a rule appears not to work.

HeaderRBAC apiGroupResourceScope of the grant
Impersonate-User (human or other user)"" (core)usersCluster-wide: needs ClusterRole and ClusterRoleBinding
Impersonate-Group"" (core)groupsCluster-wide
Impersonate-User naming a service account"" (core)serviceaccountsGrant can be namespaced, but the service account can act outside that namespace
Impersonate-Uidauthentication.k8s.iouidsCluster-wide
Impersonate-Extra-scopes (example)authentication.k8s.iouserextras/scopesCluster-wide; one subresource per extra name

The documentation is explicit that impersonating a user or group is not namespace scoped, because the impersonated identity can do anything it is permitted to do anywhere. A Role and RoleBinding cannot express user or group impersonation; only a ClusterRole bound with a ClusterRoleBinding can. The Kubernetes RBAC good practices page lists impersonate alongside escalate, bind, nodes/proxy and CSR approval as permissions that let holders gain rights beyond what the role appears to grant.

Scoping impersonation with resourceNames

The classic verb can be narrowed only by restricting which values the headers may carry. Do this for every rule. A support role that needs to reproduce a developer's view of the cluster might look like this:

1 Sample only, based on the public documentation cited. Assess it independently against the current official documentation, test outside production and back up first.

Sample 1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: support-impersonate-dev-view
rules:
- apiGroups: [""]
  resources: ["users"]
  verbs: ["impersonate"]
  resourceNames: ["dev-readonly"]
- apiGroups: [""]
  resources: ["groups"]
  verbs: ["impersonate"]
  resourceNames: ["developers"]

Points to check when writing these rules:

  • Name the group as well as the user: if groups is granted without resourceNames, the holder can add system:masters to any impersonated user and bypass RBAC entirely, because that group skips authorisation checks and webhooks.
  • Choose low-privilege targets: impersonating a named identity is only as safe as that identity. Pick dedicated read-only users or groups as targets, never an administrator.
  • Treat service account targets as workload credentials: naming a controller's service account grants everything that controller can do. Prefer a purpose-built service account with a narrow role.
  • Avoid wildcards: verbs: ["*"] on any resource includes impersonate, and resources: ["*"] with impersonate covers users, groups and service accounts together.

Constrained impersonation

The upstream docs note that with the classic verb impersonation "either grants full impersonation or none at all". Constrained impersonation, controlled by the ConstrainedImpersonation feature gate (alpha in v1.35, beta and enabled by default from v1.36 according to the feature gate reference checked in November 2026), splits the grant into two permissions: who may be impersonated, and what may be done while impersonating. All verbs use the authentication.k8s.io group.

ModeApplies when the impersonated userIdentity verbAction verb
user-infoDoes not start with system:serviceaccount: or system:node:impersonate:user-infoimpersonate-on:user-info:<verb>
serviceaccountIs a service accountimpersonate:serviceaccountimpersonate-on:serviceaccount:<verb>
arbitrary-nodeStarts with system:node:, any nodeimpersonate:arbitrary-nodeimpersonate-on:arbitrary-node:<verb>
associated-nodeIs the node the impersonating service account is bound toimpersonate:associated-nodeimpersonate-on:associated-node:<verb>

The action verbs are granted on the real target resource (for example pods in one namespace) through an ordinary Role or ClusterRole, so a controller can be allowed to impersonate a user only to list and watch pods in default. Existing impersonate rules keep working: the API server checks constrained permissions first and falls back to the classic verb. That fallback means adopting constrained impersonation does not remove risk until the old broad rules are deleted. Check your distribution and version before relying on it, and check managed service release notes, since providers control feature gates.

Legitimate uses

UseWho holds the verbSafer pattern
Testing what a user or service account can doPlatform administratorsRun kubectl auth can-i --list --as=... as an administrator; for delegated testers, grant impersonation only to named low-privilege test identities
Reduced-privilege daily administrationAdministrators using a low-privilege accountThe RBAC good practices page suggests a low-privilege account with impersonation rights to avoid accidental changes; pair with short-lived credentials and alerting on each elevation
Access proxies and multi-cluster consolesA proxy's service accountProxy authenticates the human, then impersonates them; restrict resourceNames to the groups the proxy maps, and protect the proxy credential as tier zero
Node agents reading their own node's podsA DaemonSet service accountConstrained impersonate:associated-node with impersonate-on:associated-node:list and get instead of cluster-wide pod read
Controllers acting on behalf of tenantsAn operator or GitOps controllerImpersonate a per-tenant service account so the tenant's RBAC limits what is applied; use constrained verbs to limit actions

Each of these holders is a non-human identity whose token now carries the combined reach of every identity it can impersonate. Inventory and rotate those tokens as you would any privileged credential: see the Kubernetes Service Account Token Guide and the Kubernetes NHI Security Guide.

Abuse risk explained

From a defender's point of view, the verb matters because it converts one credential into many. The main risk combinations are:

  • Unscoped groups impersonation: equivalent to cluster-admin, through system:masters, which cannot be revoked by removing bindings.
  • Impersonation of controller service accounts: controllers often hold secrets read, workload creation or bind; impersonating them inherits all of it.
  • Impersonation plus bind or escalate: a holder can create a binding that grants itself broader impersonation, defeating any later scoping. The ATT&CK technique T1098 Account Manipulation describes this class of change.
  • Stolen tokens of proxy or controller identities: whoever holds the token holds the impersonation rights, a form of T1078 Valid Accounts. Secrets exposure inside clusters makes this likely: see the Kubernetes Secrets Security Guide.
  • Node impersonation: impersonate:arbitrary-node or classic impersonation of system:node:* names gives the API access of a node identity. Reserve it for agents that genuinely need it and prefer associated-node.

Auditing impersonated requests

Kubernetes logs nothing unless kube-apiserver is started with --audit-policy-file, and a policy with zero rules is invalid. At the Metadata level every event records the requesting user, verb and resource, which is enough to see impersonation. Managed services expose the same events through their control-plane logging, which usually has to be switched on.

Audit fieldWhat it showsDetection use
user.usernameThe real authenticated callerAttribute the action to the human or service account behind it
impersonatedUser.username and .groupsThe identity the request ran asAlert on system:masters, system:node:*, admin users or controller service accounts
authenticationMetadata.impersonationConstraintConstrained verb used, such as impersonate:user-infoConfirm traffic is moving off the classic verb
sourceIPs, userAgentOrigin and client (user agent is client supplied, not trusted)Spot impersonation from unexpected networks or tools
verb, objectRef, responseStatus.codeAction, target and resultRepeated 403s while impersonating suggest probing
Annotation apiserver.latency.k8s.io/impersonationImpersonation processing time for slow non-watch requestsPerformance troubleshooting only

Alongside audit logs, kube-apiserver exposes the metric apiserver_impersonation_attempts_total{mode, decision}, where mode legacy counts use of the classic verb. Watch RBAC changes as well: create, update or patch on clusterroles, roles and their bindings where the rules include impersonate. The Kubernetes Audit Log Detection Guide covers pipeline design, and Reading Service Account Activity in Kubernetes Audit Logs covers service account attribution.

Metrics that show control

  • Number of subjects holding impersonate, by role, with a target of a short, documented list.
  • Percentage of impersonate rules with resourceNames set (target 100%).
  • Count of rules granting impersonate through wildcards (target zero).
  • Share of impersonated requests using constrained verbs versus legacy mode, trending up after rollout.
  • Time from an alert on impersonation of a privileged identity to triage.

Rolling out restrictions safely

  1. Inventory: export all ClusterRoles and Roles and list every rule whose verbs include impersonate or *, then map each to its bindings and subjects.
  2. Observe: with audit at Metadata, collect two to four weeks of impersonatedUser values per caller to learn real usage.
  3. Scope: rewrite each rule with resourceNames matching observed values; test with kubectl auth can-i impersonate users/<name> --as=<holder> in a non-production cluster first.
  4. Constrain: where your version supports it, add constrained verbs for controllers and proxies, then delete the classic rules, since the server falls back to them.
  5. Roll back: keep the previous manifests in version control and re-apply them if a proxy or controller breaks; failures appear as 403 responses with the impersonated identity in audit.
  6. Prevent drift: add an admission or CI policy that rejects new impersonate rules without resourceNames. See the Kubernetes Admission Control Guide.

Framework mapping

FrameworkReferenceHow it applies
NIST SP 800-53 Rev 5AC-6 Least Privilege; AC-6(9) Log Use of Privileged FunctionsScope impersonation by name; audit every impersonated request
NIST SP 800-53 Rev 5AU-2, AU-12, AU-6Audit policy enabled, events generated and reviewed
NIST CSF 2.0PR.AA-05; DE.CM-03Entitlements reviewed under least privilege; activity monitored
MITRE ATT&CK v20T1078 Valid Accounts; T1098 Account ManipulationUse of stolen holder tokens; bindings changed to widen impersonation

Practitioner checklist

  • List every subject that holds impersonate directly or through *, and record an owner and reason for each.
  • Add resourceNames to every impersonate rule, and never allow unscoped groups impersonation.
  • Remove anyone other than break-glass identities from system:masters and alert on its impersonation.
  • Use dedicated low-privilege identities as impersonation targets for support and testing.
  • Adopt constrained impersonation for controllers, proxies and node agents where your version supports it, then delete the classic rules.
  • Enable an audit policy at least at Metadata and alert on privileged impersonatedUser values.
  • Monitor RBAC changes that add impersonate, bind or escalate.
  • Protect and rotate the tokens of every identity that can impersonate, as tier-zero credentials.

Standards and references

Related NHI Mgmt Group resources: Kubernetes RBAC Guide · How to audit Kubernetes cluster admin bindings · Kubernetes Audit Log Detection Guide · Kubernetes NHI Security Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.