AWS
Iam

πŸ” 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:

  1. Explicit Deny always wins
  2. Then Allow
  3. 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


πŸ’¬ Need a Quick Summary?

Hey! Don't have time to read everything? I get it. 😊
Click below and I'll give you the main points and what matters most on this page.
Takes about 5 seconds β€’ Uses Perplexity AI