liveBook · Manning

Security token

As explained in Acing the Certified Kubernetes Administrator Exam, Second Edition

An authentication token is a credential value presented by a client or workload to authenticate access to an API or service.

A security token is a credential value that authenticates a client or workload to the Kubernetes API. Service Accounts provide tokens for machines and pods, while RBAC roles and bindings limit what those identities can do. section 3.4 section 3.3

Use these operational rules when working with tokens:

  • Kubernetes automatically creates a default Service Account in each namespace and mounts its API credential into pods unless mounting is disabled. section 3.3
  • Modern clusters obtain API credentials through the TokenRequest API and mount them with a projected volume; older clusters used long-term token Secrets. section 3.3 section 3.3
  • Treat tokens as sensitive credentials because they can authenticate from outside the cluster; grant only the required permissions through roles and role bindings. section 3.3 section 3.3

Grant and verify limited pod access

Create a role with kubectl create role pod-list --verb=list --resource=pods, bind it to a Service Account, then verify access with kubectl auth can-i list pods --as system:serviceaccount:default:nomount-sa.

How Acing the Certified Kubernetes Administrator Exam, Second Edition covers it

How deep it goes
Explains mounting, credential-generation mechanisms, exposure risks, and permission verification, but does not detail token cryptography.
Examples
Uses namespace defaults, mounted pod credentials, disabled automounting, role bindings, and kubectl auth can-i verification.
What you can do after
Apply it via kubectl to authenticate workloads, restrict their permissions, disable unnecessary mounts, and test effective access.
How it connects
Connects authentication with Service Accounts, the Kubernetes API, RBAC, roles, role bindings, and projected volumes.

Also explained in

Compare how 2 books explain security token →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the Certified Kubernetes Administrator Exam, Second Edition. The section links point to the parts of the book it draws on.