Skip to main content
We continue our container security series with a focused look at Amazon Elastic Kubernetes Service (EKS). This article explains how workloads authenticate to AWS services, EKS IAM constructs (cluster, node, pod), networking and storage security, and operational controls you should enable. Diagrams and quiz slides are preserved in their original sequence to keep the architecture context intact.
Historically, Kubernetes workloads were given permissions at the node level. Today the recommended pattern is IAM Roles for Service Accounts (IRSA), which uses an OpenID Connect (OIDC) provider tied to the EKS cluster. With IRSA, a pod (via its Kubernetes service account) presents a service-account JWT to AWS STS using the AssumeRoleWithWebIdentity flow and receives temporary credentials scoped by the IAM role policy. Conceptual components:
  1. An OIDC provider registered in IAM that represents the EKS cluster issuer.
  2. A Kubernetes ServiceAccount annotated with the IAM role ARN for pods that need permissions.
  3. The pod (or AWS SDK inside it) calls STS with the service-account JWT and role ARN; STS validates the JWT against the IAM-registered OIDC provider and returns temporary credentials.
A diagram showing the AWS Elastic Kubernetes Service (EKS) IAM OIDC authentication flow. It depicts a pod using a service-account JWT to assume an IAM role and obtain temporary AWS credentials to access S3 buckets.
To summarize the IRSA/OIDC flow:
  1. Register the cluster OIDC issuer URL as an IAM OIDC identity provider (establishes trust).
  2. Create an IAM role with a trust policy that allows sts:AssumeRoleWithWebIdentity for tokens issued by that provider and restricted by sub/aud conditions.
  3. Annotate the Kubernetes service account with the IAM role ARN.
  4. Pod presents its service-account JWT to STS; STS validates the OIDC token and returns temporary credentials for AWS APIs (S3, DynamoDB, etc.).
IRSA enables least-privilege access for workloads: prefer per-service-account roles over broad node-level permissions. For details see the AWS docs for IAM Roles for Service Accounts (IRSA) and enabling OIDC for EKS.
References:

Quiz: essential step to integrate OIDC with IAM

Question: A global retail company wants to register their EKS cluster as an OIDC identity provider in IAM so Kubernetes service accounts can assume IAM roles. Which step is essential? Answer summary:
  • The essential step is enabling and using the cluster’s OIDC issuer URL to create the IAM OIDC identity provider in IAM. This establishes the trust relationship STS uses to validate service-account JWTs. Manually creating a generic OIDC provider without the cluster issuer URL is error-prone, and AWS Identity Center (SSO) is unrelated to IRSA.
A presentation slide asking which step is essential to integrate an OpenID Connect (OIDC) identity provider with AWS IAM for an Amazon EKS cluster. It shows four numbered answer choices, including enabling the cluster's OIDC provider URL, manually creating an OIDC provider, using AWS SSO, or directly associating IAM roles with nodes.

EKS IAM integration — correct summary

EKS supports IAM integration at multiple levels. The most exam- and production-relevant statement is:
  • Use IRSA: associate IAM roles with Kubernetes service accounts so pods assume AWS roles and directly access services. Pod-level identity provides finer-grained least-privilege access than node-level IAM role attachment.
A colorful infographic asking which statement accurately describes IAM integration with Amazon EKS, followed by four numbered answer choices. The options mention Kubernetes RBAC, attaching IAM policies to pods, associating IAM roles with service accounts, and manual synchronization.

Cluster, node, and pod IAM roles — responsibilities

Table: IAM role purposes in EKS Connector roles are primarily for management-plane integrations; they are not a substitute for least-privilege pod or node roles. Pod/Node/Cluster quiz context (short):
  • Cluster role: EKS control plane needs rights to create/manage AWS resources (EC2, ELB).
  • Node role: Needed to pull container images and send logs (ECR, CloudWatch).
  • Pod execution (IRSA): Preferred to let individual pods assume roles and access services.

Node types: responsibility tradeoffs

A diagram illustrating Amazon Elastic Kubernetes Service (EKS) architecture. It shows the EKS control plane and VPC with availability zones containing EC2 (managed and self-managed) and Fargate nodes, plus ECR and client connectivity over the internet.

Large architecture walkthrough

The diagram below consolidates key components and interactions: multi-AZ VPC layout, public/private subnets, NAT & Internet Gateways, load balancers, storage (EBS, EFS, FSx), databases, ECR, and EKS control plane. Note where security controls apply — network boundaries, IAM trust, encryption, logging, and detection (CloudWatch, Config, GuardDuty). Review each component to identify where to apply controls:
  • Network segmentation (subnets, NACLs, Security Groups)
  • IAM least privilege (IRSA, node roles)
  • Data protection (KMS, encrypted volumes)
  • Observability (control plane logs, node/app logs)
A technical AWS architecture diagram for Elastic Kubernetes Service (EKS) showing a multi‑AZ VPC with public/private subnets, NAT gateways, EKS clusters, and associated AWS services (RDS, EBS, EFS, ELB, ECR, etc.). A side note explains EKS dumps control plane logs into CloudWatch Logs (API, Audit, Authenticator, ControllerManager, Scheduler).

EKS advantages

  • AWS manages the EKS control plane (high availability, automated patching).
  • EKS integrates with core AWS services (IAM, CloudWatch, VPC), improving observability and operational security.

Data protection: encryption at rest and in transit

  • Kubernetes Secrets are Base64-encoded by default — not strongly encrypted. Enable KMS-integrated envelope encryption for Kubernetes secrets and use customer-managed KMS keys (CMKs) when you require strong encryption.
  • Ensure underlying volumes (EBS, EFS, FSx) are encrypted. Use the CSI drivers and StorageClass parameters to request encrypted storage dynamically.
An infographic posing a question about how an e-commerce company should ensure data encryption when deploying containerized microservices on Amazon EKS. It lists four answer options (e.g., enable AWS KMS for Kubernetes secrets, manually encrypt in the application, use ACM certificates, and encrypt underlying EC2 instance storage).
Kubernetes Secrets are not encrypted by default. If your workloads handle sensitive data, enable KMS-backed encryption of secrets and ensure storage volumes are encrypted with appropriate KMS keys.

Detection and logging (control plane & nodes)

  • Enable EKS control plane logs in the cluster settings (API, audit, authenticator, controllerManager, scheduler) and stream them to CloudWatch Logs for audit and incident investigations.
  • Collect node and application logs with Fluentd/Fluent Bit and forward to CloudWatch or your logging pipeline.
  • Control plane logs are configured via the EKS cluster logging settings; node/app logs are collected by agents running on the nodes or as DaemonSets.
A technical AWS architecture diagram for Elastic Kubernetes Service (EKS) showing a multi‑AZ VPC with public/private subnets, NAT gateways, EKS clusters, and associated AWS services (RDS, EBS, EFS, ELB, ECR, etc.). A side note explains EKS dumps control plane logs into CloudWatch Logs (API, Audit, Authenticator, ControllerManager, Scheduler).

Multi-tenancy considerations

Kubernetes provides primitives (namespaces, RBAC, resource quotas, NetworkPolicy) for logical isolation, but the cluster boundary is the strongest isolation boundary. For strict tenant isolation, use separate clusters and VPCs. Common hybrid approach:
  • Single cluster for cost efficiency + namespaces + RBAC + network policies + quotas for team isolation.
  • Use dedicated clusters for tenants with strict compliance or blast-radius isolation requirements.
A diagram of a multi-tenant Elastic Kubernetes Service architecture. It shows per-tenant namespaces with ingress, IAM roles and Order/Product microservices connecting to DynamoDB tables, plus a tenant deployment pipeline using AWS CodePipeline/CodeBuild/CloudFormation.

Network security and NetworkPolicy

  • By default pod-to-pod traffic is allowed. To restrict east-west traffic, use Kubernetes NetworkPolicy objects together with the AWS VPC CNI plugin (which gives pods VPC IP addresses).
  • Security Groups for Pods can also provide AWS-level filtering, but NetworkPolicy is the Kubernetes-native enforcement mechanism.
  • Example configuration toggle (as JSON):
Best practice: combine Kubernetes NetworkPolicy + VPC CNI + Security Groups for Pods when you need layered enforcement.
The image is a quiz slide asking how to implement pod-level network policies using Security Groups in Amazon EKS. It lists four numbered options describing different approaches (assign SGs to individual pods, use Security Groups for Pods, use a single SG with Kubernetes Network Policies, or apply SGs at node level and rely on RBAC).

Service mesh and mTLS

  • If you need end-to-end encryption and mutual authentication between services, deploy a service mesh that supports mutual TLS (mTLS). AWS App Mesh, Istio, and Linkerd are common choices.
  • Use mTLS where regulatory or security requirements demand encryption-in-transit and strong service identity.
An infographic-style multiple-choice question about a global financial institution deploying applications on Amazon EKS and seeking a service mesh for end-to-end encryption. Four answer options are shown, including using AWS App Mesh with mutual TLS (mTLS), a custom mesh without mTLS, App Mesh without encryption, or relying on EKS node-level encryption.

Load balancing: ALB vs. NLB and the AWS Load Balancer Controller

  • ALB (Application Load Balancer): Use for HTTP/HTTPS Layer 7 features such as path-based routing, host-based routing, and WAF integration. Use the AWS Load Balancer Controller (previously ALB Ingress Controller) to provision ALBs for Ingress resources.
  • NLB (Network Load Balancer): Use when you need ultra-low latency, extreme performance, or TCP/UDP passthrough. The AWS Load Balancer Controller can provision NLBs for Service resources or annotated Ingress/Service manifests.
A colorful infographic slide describes an e-commerce scenario asking how to handle high-volume, low-latency traffic to backend services on Amazon EKS using a Network Load Balancer. Four numbered answer options are shown, including one recommending the AWS Load Balancer Controller to auto-provision an NLB and route traffic directly to pods.
References:

CSI drivers and storage encryption

Use the official Kubernetes CSI drivers for EBS, EFS, and FSx and configure encryption in StorageClass or PersistentVolume definitions so dynamically provisioned volumes are encrypted at creation. Example StorageClass for EBS (illustrative):
  • For EFS and FSx CSI drivers: set encryption parameters in the StorageClass or provision volumes with encryption enabled and use KMS CMKs if required.
A slide showing a question about ensuring EBS volumes provisioned by the EKS CSI driver are encrypted at rest. It also displays four numbered answer options (manual encryption, set encrypted=true in the StorageClass, enable EBS encryption in the console after provisioning, and use IAM policies).
A slide titled "Elastic Kubernetes Service" showing an architecture diagram for using FSx for Lustre with Amazon EKS and EMR on EKS. It illustrates a developer submitting Spark jobs to EMR on EKS, which provisions persistent volumes via the FSx CSI driver to an FSx for Lustre filesystem that can sync with Amazon S3.

Summary checklist for production EKS security:
  • Use the cluster OIDC provider + IRSA for least-privilege pod access to AWS services.
  • Enable KMS-backed encryption for Kubernetes secrets and ensure CSI-backed volumes are created encrypted.
  • Export EKS control plane logs to CloudWatch and collect node/app logs with Fluent Bit/Fluentd.
  • Apply Kubernetes NetworkPolicy and use the VPC CNI + Security Groups for Pods to control east-west traffic.
  • Choose node type (self-managed vs managed node group vs Fargate) according to compliance and operational capability.
  • Use the AWS Load Balancer Controller for ALB/NLB provisioning and pick ALB for L7 routing and NLB for extremely high-performance needs.
  • Consider a service mesh with mTLS for strong inter-service encryption/identity when needed.
Further reading and references: If you want, I can produce example Kubernetes manifests for IRSA, annotated ServiceAccount YAML, a StorageClass for encrypted EBS, or templates for NetworkPolicy and Load Balancer Controller annotations.

Watch Video