Interview Prep/Kubernetes/Security, RBAC and policy

A pod has access to the node's IAM role through IMDS. How do you prevent credential theft?

AdvancedScenarioSecurity, RBAC and policy
Answer

Situation read → A compromised pod can query 169.254.169.254 and use node permissions.

What I'd do →

  1. Enforce IMDSv2 with hop limit 1 on node launch templates
  2. Use IRSA or Pod Identity for workload permissions
  3. Block 169.254.169.254 with a NetworkPolicy for pods that do not need it
  4. Keep the node role minimal
  5. Detect with GuardDuty EKS protection

Why → Hop limit 1 stops containers from reaching IMDS through the extra network hop.

Interview tip → Credential theft via IMDS is a classic cloud breach path.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Security, RBAC and policy