RBACOverview

RBAC (Role-Based Access Control)

Kubernetes Role-Based Access Control (RBAC) allows you to regulate access to resources based on the roles of individual users within your cluster. SRExpert provides a visual interface to manage RBAC resources.

Overview

RBAC in Kubernetes uses four main resource types:

ResourceScopeDescription
RolesNamespaceDefine permissions within a specific namespace
Role BindingsNamespaceGrant permissions defined in a Role to users/groups
Cluster RolesCluster-wideDefine permissions across the entire cluster
Cluster Role BindingsCluster-wideGrant cluster-wide permissions to users/groups

Key Concepts

Roles vs Cluster Roles

  • Roles are namespace-scoped and can only grant access to resources within a single namespace
  • Cluster Roles are cluster-scoped and can grant access to cluster-wide resources (like nodes) or resources in all namespaces

Bindings

Bindings connect roles to subjects (users, groups, or service accounts):

  • Role Bindings grant the permissions defined in a Role to subjects within the same namespace
  • Cluster Role Bindings grant the permissions defined in a Cluster Role to subjects across the entire cluster

Accessing RBAC in SRExpert

Navigate to Workloads > Access Control to manage RBAC resources:

  1. Service Accounts - Kubernetes service accounts used by pods
  2. Roles - Namespace-scoped permission sets
  3. Role Bindings - Connect roles to subjects within a namespace
  4. Cluster Roles - Cluster-wide permission sets
  5. Cluster Role Bindings - Connect cluster roles to subjects cluster-wide

Best Practices

  1. Principle of Least Privilege - Grant only the minimum permissions necessary
  2. Use Namespaces - Organize resources and limit role scope using namespaces
  3. Avoid Wildcards - Be specific about resources and verbs instead of using *
  4. Regular Audits - Periodically review roles and bindings to remove unnecessary permissions
  5. Use Groups - Bind roles to groups rather than individual users when possible