Interview Prep/DevSecOps/Secrets and Identity Management

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 →

  1. Use EKS Pod Identity (or IRSA on older clusters) to bind an IAM role to a service account.
  2. 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.
  3. Set serviceAccountName: orders-sa in the deployment; the AWS SDK picks up credentials automatically.
  4. 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.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Secrets and Identity Management