Overview

FieldValue
ID1047
NameCreate ServiceAccount Tokens
Risk CategorySpoofing
Risk LevelCritical
Role TypeRole
API Groupsauthentication.k8s.io
Resourcesserviceaccounts/token
Verbscreate
TagsCredentialAccess Impersonation PotentialPrivilegeEscalation Spoofing TokenCreation

Description

Allows creating tokens for ServiceAccounts within a specific namespace. If a ServiceAccount has powerful permissions, creating a token for it allows impersonating that ServiceAccount, leading to potential privilege escalation, credential access, and spoofing.

Abuse Scenarios

  1. Create a new service account token for a specific service account.
kubectl create token <serviceaccount-name> -n <namespace>
# Example: kubectl create token default -n default
  1. Create a new service account token with a specific expiration time.
kubectl create token <serviceaccount-name> -n <namespace> --duration=1h
# Example: kubectl create token my-app-sa -n production --duration=24h