AWS EKS Pod Identity là gì ? So sánh với AWS EKS IRSA

images

AWS mới release một tính năng mới cho EKS: Pod Identity, vậy tính năng này có điểm gì nổi bật ?

Trước khi bắt đầu, ta cùng nhắc lại một chút về cách ta tương tác với các AWS services từ trong EKS Pod:

Phương pháp Cơ chế hoạt động Ưu điểm Nhược điểm & Rủi ro
Cách 1: Static User Tạo IAM User, lấy Access Key & Secret Key và cấu hình trực tiếp vào ứng dụng/container.

• Nhanh nhất.

 

• Đơn giản, dễ thực hiện.

Bảo mật kém: Sử dụng Long-lived token (nếu lộ key, ai cũng dùng được).

 

Khó vận hành: Việc thay thế (rotate) key khi phân phối trên nhiều hệ thống rất phức tạp và tốn công.

Cách 2: IAM Role cho Worker Node Tạo IAM Role/Policy và gắn (attach) vào Worker Node (EC2 Instance Profile). Sử dụng AWS STS để lấy token. An toàn hơn Cách 1: Sử dụng Temporary token (token tạm thời), không còn lo ngại về long-lived credential. Vi phạm nguyên tắc đặc quyền tối thiểu (Least Privilege): Vì role gắn vào Node, nên tất cả các Pod chạy trên Node đó đều có quyền sử dụng Role này, dẫn đến rủi ro bảo mật lớn nếu một Pod bị xâm nhập.
Cách 3: IRSA (IAM Roles for Service Accounts) Kết hợp OIDC Provider, AWS IAM Trust Policy và Kubernetes Service Account (thông qua Annotation).

Bảo mật cao nhất: Kiểm soát quyền truy cập chi tiết đến cấp độ Pod (Fine-grained control).

 

• Tuân thủ nguyên tắc Least Privilege.

Cấu hình phức tạp: Cần thiết lập nhiều thành phần (OIDC, Trust relationship, K8s Service Account…).

 

Khó mở rộng: Phức tạp khi quản lý nhiều cluster trong cùng 1 account, có thể chạm giới hạn (limits) từ phía AWS.

Và đó là lý do AWS cho ra mắt EKS Pod Identity

Bổ sung, sự khác nhau giữa Pod Identity và IRSA:

Feature EKS Pod Identity IRSA
Role Extensibility No need to update the role’s trust policy for each new cluster. Need to update role’s trust policy with new EKS cluster OIDC provider endpoint.
Cluster Scalability No need to setup IAM OIDC provider. Need to setup IAM OIDC provider. Default global limit of 100 OIDC providers for AWS account applies.
Role Scalability No need to define trust relationship between IAM role and service account in the trust policy. Need to define trust relationship between IAM role and service account in the trust policy. Max of 8 trust relationships within a single trust policy applies due to limit on trust policy size.
Role Reusability AWS STS temporary credentials supplied by EKS Pod Identity include role session tags, such as cluster name, namespace, service account name. AWS STS session tags are not supported. You can reuse a role between clusters but every pod receives all of the permissions of the role.
Environments Supported Only available on Amazon EKS. IRSA can be used with Amazon EKS, Amazon EKS Anywhere, Red Hat OpenShift Service on AWS, and self-managed Kubernetes clusters on Amazon EC2 instances.
EKS Versions Supported EKS Kubernetes versions 1.24 or later. All of the supported EKS cluster versions.

Exit mobile version