Interview Prep/DevSecOps/Identity, Least Privilege & OIDC for CI

How do you give Kubernetes workloads cloud access with least privilege?

IntermediateProductionIdentity, Least Privilege & OIDC for CI
Answer

One cloud role per workload (service account), never per node. On EKS use EKS Pod Identity (simpler association API, no OIDC provider per cluster) or IRSA; on GKE, Workload Identity Federation; on AKS, Microsoft Entra Workload ID.

aws eks create-pod-identity-association --cluster-name prod \
  --namespace payments --service-account payments-api \
  --role-arn arn:aws:iam::111122223333:role/payments-api

Block pods from using the node role: require IMDSv2 with hop limit 1 so containers cannot reach node credentials.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Identity, Least Privilege & OIDC for CI