π AWS IAM β Full DevOps Interview Deep Dive
β Part 1 β Core IAM Entities (Interview Foundation)
β Q1 β What are IAM Users, Roles, Groups β real difference?
User = long-term identity for a human or system (username + credentials). Group = permission container for users only β cannot be assumed. Role = temporary identity that can be assumed by users, services, or accounts.
Modern best practice: minimize users, maximize roles. Roles are safer because they use temporary credentials.
β Q2 β Why are IAM Users discouraged in modern production setups?
Because they rely on long-lived credentials (access keys/passwords). Long-lived secrets are high risk. Modern design uses SSO + role assumption + short-lived tokens. Users are mostly replaced by federated identities.
β Part 2 β IAM Policies (Where Most Interviews Go Deep)
β Q3 β What is an IAM policy really?
A policy is a JSON document defining Allow or Deny for actions on resources with optional conditions. Policies donβt attach to resources alone β they attach to identities or resources depending on type. Policy = permission logic, not identity.
β Q4 β Types of IAM policies interviewers expect you to know
- Identity-based policies (attached to user/role/group)
- Resource-based policies (attached to resource like S3 bucket)
- Trust policies (who can assume role)
- Permission boundaries
- SCPs (org-level guardrails)
If you miss trust vs permission β senior interview red flag.
β Q5 β How AWS evaluates permissions (critical interview topic)
Evaluation logic:
- Explicit Deny always wins
- Then Allow
- If no Allow β implicit deny
Multiple policies are combined. One deny anywhere blocks access. This is how guardrails are enforced.
β Part 3 β Roles Deep Dive (High Importance)
β Q6 β What is IAM Role assumption flow?
An identity calls sts:AssumeRole. AWS checks the trust policy of the role. If allowed, temporary credentials are issued. Those creds carry the roleβs permission policy. Access is time-limited.
β Q7 β Trust policy vs Permission policy β difference?
Trust policy = who can assume the role Permission policy = what the role can do after assumption
Trust answers βwho enters.β Permission answers βwhat they can touch.β Interviewers love this distinction.
β Q8 β Service roles vs execution roles β whatβs the difference?
Service role = role assumed by AWS service. Execution role = role used while service runs.
Example: Lambda execution role β permissions Lambda code uses at runtime. Confusing them is common interview mistake.
β Part 4 β Cross-Account Access (Senior-Level Topic)
β Q9 β How do you design cross-account access safely?
Create role in target account with trust policy allowing source account role/user. Source assumes role via STS. No sharing of keys. External ID used for third-party access. Access is temporary and auditable.
β Q10 β Why use External ID in cross-account roles?
Prevents confused deputy problem. Ensures third party assumes role only when correct external ID is provided. Common fintech vendor integration requirement.
β Part 5 β Permission Boundaries & SCP (Advanced Guardrails)
β Q11 β What is a permission boundary?
A boundary limits the maximum permissions a role/user can ever get β even if a policy grants more. Itβs a ceiling. Used in self-service environments where teams can create roles but within limits.
β Q12 β SCP vs Permission Boundary β difference?
SCP = org-level guardrail across accounts. Permission boundary = identity-level ceiling. SCP applies before identity policy. SCP cannot grant β only restrict.
β Part 6 β Conditions & Least Privilege
β Q13 β How do IAM conditions strengthen security?
Conditions restrict when/how access is allowed β IP, MFA, time, tags, VPC, TLS. Example: allow S3 only from VPC endpoint. Conditions convert broad allow into contextual allow.
β Q14 β Tag-based access control β why powerful?
Permissions based on resource tags. Enables scalable least-privilege by environment/team tags. Used heavily in platform automation.
β Part 7 β Real DevOps IAM Design Patterns
β Q15 β CI/CD IAM design best practice
CI pipeline uses dedicated role β not user keys. Role has scoped permissions only for required resources. Separate roles per environment. No wildcard admin for pipelines.
β Q16 β EKS workload IAM best practice
Use IRSA (IAM Roles for Service Accounts). Pod assumes IAM role directly. Avoid node-role over-permission. Pod-level least privilege.
β Q17 β Lambda IAM best practice
Each Lambda gets its own execution role. Only required permissions. No shared βlambda-adminβ role.
β Part 8 β Limits & Quotas
β Q18 β IAM limits interviewers may ask
- policy size limits
- number of policies per role
- role count per account
- inline vs managed policy limits
Large orgs hit these β module design matters.
β Part 9 β Common Real-World IAM Mistakes
β Q19 β Biggest IAM mistake in DevOps teams
Using *:* admin policies for speed and never fixing later. This becomes permanent risk. Least privilege must be enforced early.
β Q20 β Second biggest mistake
Using user access keys in apps instead of roles. Key leakage incidents are very common breach vector.
β Part 10 β When Interviewers Push Further
Expect follow-ups like:
- explain policy evaluation with SCP + boundary + identity policy
- debug βaccess deniedβ step-by-step
- design IAM for multi-team platform
- design least privilege for Terraform
- design IAM for cross-account CI/CD