Kubernetes service-account token mounting deserves an explicit opt-out
Every Kubernetes Pod receives credentials for its assigned ServiceAccount by default. The token is convenient for controllers and operators, but many application Pods never call the Kubernetes API. Leaving an API credential in those containers increases the value of a workload compromise.
The default is useful and broad
The Kubernetes documentation says the kubelet provides a Pod with credentials for the default ServiceAccount unless the Pod selects another one. It also documents automountServiceAccountToken: false on a ServiceAccount or a Pod. The Pod-level setting takes precedence when both are present.
The token is not a generic password for the application. It authenticates to the Kubernetes API as the ServiceAccount, subject to RBAC and admission policy.…