Interview Prep/DevSecOps/Cloud IAM and Compliance

A developer can create IAM roles for their Lambdas. How do you stop them from creating an admin role for themselves?

AdvancedScenarioCloud IAM and Compliance
Answer

Situation read → iam:CreateRole plus iam:PassRole or AttachRolePolicy is a privilege escalation path. Permission boundaries close it.

What I'd do →

  1. Create a boundary policy defining the maximum any developer-created role can do.
  2. Allow iam:CreateRole only when the boundary is attached:
"Condition": { "StringEquals": { "iam:PermissionsBoundary": "arn:aws:iam::111122223333:policy/dev-boundary" } }
  1. Deny deleting or changing the boundary policy itself and deny iam:DeleteRolePermissionsBoundary.
  2. Restrict role names to a prefix (app-*) so they cannot modify platform roles.

Why → Teams self-serve roles, but no role they create can exceed the boundary.

Interview tip → Effective permissions = identity policy ∩ boundary ∩ SCP.

All DevSecOps questions Roadmap: Policy as code

More on Cloud IAM and Compliance