In Kubernetes clusters, we often wish to provide temporary credentials to the containerised processes running in a particular pod, usually marked by associating the pod with a service account.
Recently (in late 2023) AWS introduced "EKS Pod Identities", as a new mechanism for associating AWS IAM roles with k8s pods (selected via k8s service account associations).
Traditional IRSA (IAM Roles for Service Accounts) used OIDC. This involved having configured a trust relationship between the AWS account and the cluster control plane, so that pod processes could exchange their k8s service account tokens for IAM credentials. The AWS SDKs transparently handle this authorisation exchange (also appending role session names taken from an environment variable so as to volunteer finer grained metadata into the logs of accessed AWS services).
IRSA has been strongly advocated as a replacement of passing long-lived IAM keys into pods (which is more susceptible to leakage and demands regular maintenance for credential rotation). IRSA has also been strongly advocated as a replacement of associating IAM roles with EC2 instance host nodes (for compartmentalisation and to mitigate escalation attacks), with many sources advising admins to block or disable the Instance MetaData Service that facilitates instance identity roles.
How do EKS Pod Identities compare to traditional IRSA, particularly from a security standpoint? Is it still implemented identically under the hood (just transparently pre-configuring AWS STS with the thumbprint to recognise each EKS cluster)? The docs suggest EKS Pod Identities is similar to EC2 instance IAM roles, so does the implementation also expose similar fresh security concerns?