Skip to content

Lesson 01 — Kubernetes Authentication

By the end of this lesson, you will be able to:

  • Understand Kubernetes authentication
  • Explain the authentication workflow
  • Identify different authentication methods
  • Understand how Amazon EKS authentication works
  • Differentiate authentication from authorization
  • Recognise authentication security risks
  • Apply enterprise authentication best practices

Every enterprise Kubernetes cluster contains sensitive resources, including:

  • Customer applications
  • Production databases
  • Secrets
  • Certificates
  • Internal APIs
  • Cloud credentials

Before Kubernetes allows anyone to perform an action, it must first answer one question:

Who are you?

This process is called Authentication.

Without authentication, anyone could potentially:

  • Create Pods
  • Delete applications
  • Access Secrets
  • Modify RBAC
  • Compromise the entire cluster

Authentication is therefore the first layer of Kubernetes security.


Authentication is the process of verifying the identity of a user, application, or service attempting to access the Kubernetes API Server.

Authentication only confirms identity.

It does not determine what actions are permitted.

For example:

User
API Server
Authentication
Identity Verified
Authorization

Authentication always occurs before authorization.


These two concepts are often confused.

Authentication Authorization
Who are you? What can you do?
Identity verification Permission evaluation
First security step Second security step
Uses certificates, tokens, IAM Uses RBAC, ABAC or Webhooks

Example:

Rohit
Authentication
Verified
Authorization
Can Create Pods

Authentication confirms identity.

Authorization determines permissions.


Every request follows the same process.

User
kubectl
API Server
Authentication
Authorization
Admission Controllers
API Executed

If authentication fails, Kubernetes immediately rejects the request.


Kubernetes authenticates multiple identities.

Examples include:

  • Administrators
  • Developers
  • DevOps Engineers
  • Cloud Security Engineers
  • CI/CD Pipelines
  • Applications
  • Service Accounts
  • External Automation Tools

Every identity should be authenticated securely.


Kubernetes supports several authentication mechanisms.

Authentication Method Typical Usage
Client Certificates Cluster administrators
Bearer Tokens Applications
Service Accounts Pods
OpenID Connect (OIDC) Enterprise Identity Providers
AWS IAM Amazon EKS
Authentication Proxy Enterprise gateways
Webhook Authentication External authentication systems

Different organisations may use different combinations depending on their security requirements.


One of the oldest authentication methods is the use of X.509 certificates.

Example:

Administrator
Client Certificate
API Server
Verified Identity

Certificates provide strong cryptographic authentication but require certificate lifecycle management.


Applications often authenticate using Bearer Tokens.

Example:

Application
Bearer Token
API Server
Authenticated

Bearer Tokens should always be:

  • Short-lived
  • Rotated regularly
  • Protected during transmission

Every Kubernetes Pod can authenticate using a Service Account.

Pod
Service Account
API Server
Authenticated

Service Accounts allow workloads to communicate securely with the Kubernetes API.

Later in this module, you will explore Service Accounts in detail.


Many enterprises integrate Kubernetes with their corporate Identity Provider (IdP).

Common providers include:

  • Microsoft Entra ID (Azure AD)
  • Okta
  • Ping Identity
  • Google Workspace
  • Keycloak

Authentication flow:

User
Corporate Identity Provider
OIDC Token
Kubernetes API Server
Authenticated

This enables centralised identity management.


Amazon EKS integrates Kubernetes with AWS Identity and Access Management (IAM).

Example:

AWS IAM User
AWS STS
Temporary Credentials
Amazon EKS
Kubernetes API Server

Users authenticate with AWS IAM before accessing Kubernetes.

This eliminates the need to manage Kubernetes user accounts separately.


Enterprise organisations commonly use:

  • IAM Users
  • IAM Roles
  • IAM Groups
  • IAM Identity Center
  • Cross-account IAM Roles

Authentication is typically performed using temporary AWS Security Token Service (STS) credentials.

Temporary credentials are more secure than long-lived access keys.


Applications running inside Pods often need access to AWS services.

Instead of storing AWS access keys inside Pods, Amazon EKS supports IAM Roles for Service Accounts (IRSA).

Example:

Pod
Service Account
IAM Role
Amazon S3

Benefits include:

  • No long-lived credentials
  • Automatic credential rotation
  • Fine-grained permissions
  • Improved auditability

IRSA is considered an AWS security best practice.


Most authentication methods rely on tokens.

Example:

User Login
Authentication Token
API Request
Token Validation
Access Granted

Enterprise tokens should:

  • Expire automatically
  • Be encrypted during transmission
  • Never be stored in source code
  • Be rotated regularly

Production Kubernetes environments should require MFA for human users.

Authentication flow:

Username
Password
MFA
Authenticated

MFA significantly reduces the risk of account compromise.


Developer
AWS IAM Identity Center
AWS IAM Role
AWS STS
Amazon EKS Authentication
Kubernetes API Server
RBAC Authorization
Cluster Access

This architecture is commonly used in enterprise AWS environments.


Cloud Security Engineers frequently encounter:

  • Shared administrator accounts
  • Long-lived access keys
  • Missing MFA
  • Exposed authentication tokens
  • Compromised Service Accounts
  • Weak certificate management
  • Hardcoded credentials
  • Excessive IAM permissions
  • Stolen kubeconfig files
  • Expired certificates

Weak authentication often leads to complete cluster compromise.


A financial institution uses Amazon EKS for its payment platform.

Authentication process:

  • Developers authenticate using AWS IAM Identity Center.
  • Multi-Factor Authentication is required.
  • Temporary AWS STS credentials are issued.
  • IAM Roles determine Kubernetes access.
  • RBAC limits access to development namespaces.
  • Production access is restricted to platform administrators.

Every authentication event is logged using:

  • AWS CloudTrail
  • Kubernetes Audit Logs
  • Amazon GuardDuty
  • AWS Security Hub

This architecture provides strong identity verification and comprehensive auditing.


As a Kubernetes Security Engineer:

  • Integrate Kubernetes with enterprise identity providers.
  • Prefer AWS IAM authentication for Amazon EKS.
  • Require Multi-Factor Authentication.
  • Use temporary credentials instead of long-lived keys.
  • Rotate certificates and tokens regularly.
  • Protect kubeconfig files.
  • Monitor authentication failures.
  • Remove inactive users promptly.
  • Audit authentication events.
  • Apply the Principle of Least Privilege.

Strong authentication is the first step in securing any Kubernetes environment.


Security teams should monitor:

  • Failed authentication attempts
  • Multiple failed logins
  • Expired certificates
  • Stolen authentication tokens
  • Service Account misuse
  • Unusual IAM activity
  • Cross-account authentication
  • New administrator accounts
  • AWS STS usage
  • Suspicious API access

Authentication monitoring enables early detection of compromised identities.


After completing this lesson, you should understand:

  • What Kubernetes authentication is
  • How authentication differs from authorization
  • The Kubernetes authentication workflow
  • Common authentication methods
  • Amazon EKS authentication using AWS IAM
  • IAM Roles for Service Accounts (IRSA)
  • Authentication security risks
  • Enterprise authentication best practices

Authentication is the first line of defence in Kubernetes security. Once identity has been verified, Kubernetes evaluates what actions that identity is permitted to perform through authorization mechanisms such as RBAC.


What question does Kubernetes authentication answer?

  • A. What resources are available?
  • B. Who are you?
  • C. Which Pod should be scheduled?
  • D. How much CPU is available?

Answer: B


Which AWS service is used by Amazon EKS to authenticate users and workloads?

  • A. Amazon CloudWatch
  • B. AWS IAM
  • C. Amazon Route 53
  • D. Amazon SNS

Answer: B


What is the primary benefit of IAM Roles for Service Accounts (IRSA)?

  • A. Faster Pod scheduling
  • B. Automatic Worker Node scaling
  • C. Secure access to AWS services without long-lived credentials
  • D. Higher container performance

Answer: C


Which authentication mechanism allows integration with enterprise identity providers such as Microsoft Entra ID and Okta?

  • A. ClusterIP
  • B. OpenID Connect (OIDC)
  • C. ReplicaSet
  • D. ConfigMap

Answer: B


Which of the following is considered an authentication best practice?

  • A. Share administrator accounts across teams.
  • B. Store AWS access keys inside Pods.
  • C. Require Multi-Factor Authentication and use temporary credentials.
  • D. Disable authentication logs.

Answer: C


In the next lesson, you will learn about Kubernetes Authorization, where you will explore how Kubernetes determines what authenticated users, applications, and Service Accounts are allowed to do using Role-Based Access Control (RBAC), ClusterRoles, Roles, and RoleBindings.

➡️ Next Lesson: Lesson 02 — Kubernetes Authorization