AWS IAM Interview Questions
Core Concepts
Q: Explain IAM components — Users, Roles, Policies, Groups.
User: Long-term identity for a person or application. Has permanent credentials (access keys or password). Avoid for applications — use Roles instead.
Group: Collection of users. Attach policies to group, not individual users.
Role: Temporary identity assumed by AWS services, EC2 instances, Lambda functions, or cross-account access. No permanent credentials — uses temporary tokens (STS).
Policy: JSON document defining permissions (Allow/Deny + Actions + Resources + Conditions).
Best practices:
Q: How does IAM policy evaluation work?
Evaluation order (key to memorise):
Implicit deny: No policy exists → Denied.
Explicit deny: Policy exists that denies → Always denied (even with allow elsewhere).
Q: What is IRSA (IAM Roles for Service Accounts)?
IRSA allows Kubernetes pods (on EKS) to assume IAM roles without storing credentials in pods.
Trust policy allows the specific Kubernetes service account to assume the IAM role. Pods using that service account automatically get temporary AWS credentials via projected volume.
Q: What are permission boundaries?
Permission boundaries set the maximum permissions an IAM entity (user/role) can have. Even if the entity has a policy that allows more, the boundary caps it.
Use case: Allow developers to create IAM roles, but prevent privilege escalation — their boundary ensures any role they create can't exceed their own permissions.
Q: What is AWS STS? Common use cases?
STS (Security Token Service) issues temporary security credentials (up to 36 hours).
Common uses:
AssumeRole: Cross-account access, temporary elevated accessAssumeRoleWithWebIdentity: Social login (Google/Facebook) → AWS accessAssumeRoleWithSAML: Enterprise SSO (AD) → AWS accessGetFederationToken: Legacy federation
