How does RBAC work with certificates?

QuestionsQuestions8 SkillsProModify Kubeconfig FilesDec, 08 2025
065

Role-Based Access Control (RBAC) in Kubernetes works with certificates by using them for authentication and authorization. Here’s how the process works:

  1. Client Certificate Authentication:

    • When a user or service account attempts to access the Kubernetes API server, they present a client certificate.
    • The API server verifies the client certificate against its trusted Certificate Authority (CA). If the certificate is valid, the user is authenticated.
  2. User Identification:

    • The client certificate contains information about the user, such as the Common Name (CN) or Subject Alternative Name (SAN). This information is used to identify the user or service account making the request.
  3. RBAC Authorization:

    • Once authenticated, the API server checks the user's identity against the RBAC policies defined in the cluster.
    • RBAC policies consist of Roles and RoleBindings (or ClusterRoles and ClusterRoleBindings) that define what actions (verbs) the user can perform on specific resources (like pods, services, etc.) within a namespace or across the cluster.
  4. Access Decision:

    • Based on the RBAC policies, the API server determines whether the authenticated user has permission to perform the requested action. If the user has the necessary permissions, the request is allowed; otherwise, it is denied.

Summary:

RBAC in Kubernetes uses client certificates for authentication, allowing the API server to identify users and enforce access control policies based on their roles and permissions. This ensures that only authorized users can perform specific actions on cluster resources. If you have further questions or need examples, feel free to ask!

0 Comments

no data
Be the first to share your comment!