Kubernetes has its own identity and access management system built on RBAC (Role-Based Access Control). Understanding K8s RBAC is essential for securing containerized workloads and implementing Zero Trust in cloud-native environments. This lab covers user authentication, service accounts, roles, bindings, and integration with cloud provider IAM systems.
Kubernetes security is built on multiple layers: authentication (who are you?), authorization (what can you do?), and admission control (should this be allowed?). RBAC is the standard authorization mechanism, defining what actions principals can perform on which resources.
Users, Groups, ServiceAccounts - who is making the request
Role (namespaced) or ClusterRole (cluster-wide) - what permissions exist
RoleBinding or ClusterRoleBinding - connects subjects to roles
pods, services, secrets, configmaps - what is being accessed
get, list, create, update, delete, watch - what action is performed
core, apps, batch, networking.k8s.io - resource categories
Subject making request
AuthN → AuthZ → Admission
Role + RoleBinding
Allow or Deny
Learn how users and services authenticate to the Kubernetes API server.
Create and configure service accounts for pod authentication.
Create Role and ClusterRole resources to define access permissions.
Create bindings to connect users, groups, and service accounts to roles.
Implement pod-level security with security contexts and Pod Security Standards.
Connect Kubernetes service accounts to AWS IAM roles.
Connect Kubernetes service accounts to GCP service accounts.
Implement audit logging and security monitoring for Kubernetes.
Too many users/SAs with cluster-admin role.
Roles with wildcard secrets access.
Pods running as root or with privileged security context.
All pods have API access by default.