Skip to content

LS-K8S-001: Kubernetes Service Account Token

Severity CRITICAL
Blast radius Cluster compromise (scope depends on RBAC)
Rotate at https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/#bound-service-account-token-volume
Validation jwt_ok

If this leaks

Grants whatever RBAC permissions the service account has within the cluster, which can range from read-only pod access to full cluster admin.

What to do

  1. Rotate or revoke the credential at https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/#bound-service-account-token-volume.
  2. Check the provider's audit logs for use you don't recognise.
  3. Remove it from git history (leakscan purge --help) and load it from an environment variable or secret manager instead.

Pattern

eyJhbGciOiJSUzI1NiIsImtpZCI6[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}

Suppress

On one line: # leakscan:ignore LS-K8S-001. For the whole project:

disable_rules: [LS-K8S-001]