Authentication Mechanisms
Updated Mar 11, 2022 ·
Overview
Kubernetes API server supports several authentication methods to secure access to the cluster. Here's a brief description of each:
-
Static Password File Authentication
-
Stores usernames and hashed passwords in a static file.
-
Not recommended; use RBAC for new users.
-
-
Client Certificate Authentication
- Clients present a certificate signed by the cluster's CA.
- Ensures strong identity verification for both users and applications.
-
Bearer Token Authentication
- Clients send a token in request headers.
- Tokens are linked to user or service accounts.
-
Bootstrap Tokens
- Used during the bootstrapping process to set up initial cluster components.
- Replaced by other methods once the cluster is ready.
-
Service Account Tokens
- Pods and services are linked to service accounts.
- Tokens are automatically mounted in pods for API server authentication.
-
OpenID Connect Tokens
- Integrates with OpenID Connect providers.
- Supports single sign-on (SSO) and identity federation.
-
Webhook Token Authentication
- External authentication services validate tokens via webhooks.
- Response from the webhook determines authentication success.
-
Azure Active Directory (AAD) Integration
- Integrates with Azure AD for user authentication.
- Uses Azure AD identities for Kubernetes resource access.
-
Client Certificate Rotation
- Regularly rotates client certificates for improved security.
- Prevents long-term exposure of the same certificate.
-
Node Bootstrapping
- Nodes use a bootstrap token for initial registration.
- Authenticates nodes with the cluster during the bootstrap process.
These methods can be configured based on your security needs and infrastructure.