Pods need AWS access. A developer mounted an IAM user's keys as a Kubernetes Secret. What do you propose instead?
BeginnerScenarioSecrets and Identity Management
Answer
Situation read → Static keys in a Secret are base64, readable by anyone with get secrets in that namespace, and never expire.
What I'd do →
- Use EKS Pod Identity (or IRSA on older clusters) to bind an IAM role to a service account.
- With Pod Identity:
aws eks create-pod-identity-association --cluster-name prod --namespace orders --service-account orders-sa --role-arn arn:aws:iam::111122223333:role/orders-s3. - Set
serviceAccountName: orders-sain the deployment; the AWS SDK picks up credentials automatically. - Delete the Secret and deactivate the IAM user's keys.
Why → Credentials are temporary, rotated by AWS and scoped to one workload.
Interview tip → GKE has Workload Identity and AKS has Workload Identity too; same idea everywhere.
More on Secrets and Identity Management
A team stores database passwords in a `.env` file committed to a private repo. How do you migrate them out?BeginnerYour CI pipeline uses long-lived AWS access keys stored as repository secrets. How do you replace them?IntermediateAn auditor asks how often you rotate database credentials. You currently never do. What do you build?IntermediateShould you use Kubernetes Secrets, Sealed Secrets, External Secrets Operator or the Secrets Store CSI driver?IntermediateA Slack webhook URL and a Stripe live key were posted in a public GitHub issue. What is your response sequence?BeginnerHow would you set up HashiCorp Vault so Kubernetes workloads authenticate without any static token?Advanced