Menu

Kubernetes service-account token mounting deserves an explicit opt-out
📰

Kubernetes service-account token mounting deserves an explicit opt-out

DEV Community: kubernetes·OnaEiuspkz·8 days ago
#Q3zs8Rak
#devtokubernetes#devto#dev#token#kubernetes
Reading 0:00
15s threshold

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.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.