Delegating Role Creation Safely
Let teams build roles without exceeding a set guardrail.
Delegating Role Creation Safely is a free AWS Security Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AWS Security Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
The Delegation Dilemma
Teams move faster when they can create their own IAM roles and policies, but unrestricted IAM access is dangerous: a developer could grant themselves administrator rights. The challenge is letting teams build roles while guaranteeing those roles stay within safe limits. Permission boundaries make this possible, a frequently tested exam scenario.
The Privilege-Escalation Risk
Without guardrails, giving someone iam:CreateRole and iam:AttachRolePolicy is effectively giving them admin. They could create a role with AdministratorAccess and assume it. This privilege-escalation path is exactly what safe delegation must close while still allowing legitimate role creation.
Boundary as the Guardrail
The solution: require that any role a delegated user creates must have a specific permission boundary attached. Even if they attach AdministratorAccess to the new role, the boundary caps its effective permissions. The created role can never exceed what the boundary allows, neutralizing the escalation risk.
Two Conditions Needed
A safe delegation policy uses two condition checks: one ensures the new role has the required boundary (via iam:PermissionsBoundary), and another restricts the user from modifying or deleting the boundary itself. Both are needed, or a clever developer could simply remove the boundary afterward.
Requiring the Boundary
This condition forces every CreateRole call to attach the named boundary. Without it, the create action is denied.
"Condition": {
"StringEquals": {
"iam:PermissionsBoundary": "arn:aws:iam::123:policy/TeamBoundary"
}
}Protecting the Boundary Policy
You must also deny the delegated user from editing the boundary policy or detaching it from roles. Add explicit Deny statements on actions like iam:DeleteRolePermissionsBoundary and iam:CreatePolicyVersion against the boundary ARN. Otherwise the guardrail can be quietly removed, defeating the whole design.
Scoping Path and Naming
Delegation policies often restrict the path or naming of roles a user can create, for example only under /developers/. This contains their roles in a known namespace, making them easy to audit and preventing interference with privileged roles elsewhere in the account.
Permissions vs Trust
Even with a boundary, watch the new role's trust policy. A developer could create a role trusted by an external account. Restrict who they can set as trusted principals, or combine delegation with SCPs and Access Analyzer so unexpected external trust is caught and blocked.
Self-Service With Safety
Done correctly, delegation gives teams genuine self-service: they create and manage roles freely within the boundary, while the security team sleeps soundly knowing no role can exceed the cap. This balance of speed and safety is precisely what the SCS-C02 exam wants you to design.
Combining With Org Controls
For multi-account environments, pair per-identity boundaries with account-wide SCPs. The SCP sets a ceiling for the whole account, and boundaries refine limits per delegated user. Layering both gives defense in depth, so a gap in one control is caught by the other.
Putting It Together
Safe role-creation delegation requires: require a permission boundary on every created role, protect the boundary from modification or removal with explicit denies, scope paths/names, and restrict trust on new roles. Layer with SCPs for account-wide ceilings. This closes privilege-escalation paths while preserving team self-service.
Quick Check
Test safe delegation.
Recap
Delegating IAM role creation safely means requiring a permission boundary on every created role via the iam:PermissionsBoundary condition, denying changes to that boundary, scoping role paths/names, and restricting trust policies on new roles. Pair with SCPs for account-wide ceilings to close privilege-escalation paths while enabling self-service.
Frequently asked questions
Is the “Delegating Role Creation Safely” lesson free?
Yes — the full text of “Delegating Role Creation Safely” is free to read here on the web, and the AWS Security Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AWS Security Academy course, upgrade to CoddyKit PRO.
What will I learn in “Delegating Role Creation Safely”?
Let teams build roles without exceeding a set guardrail. You practise AWS Security Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start AWS Security Academy?
No prior experience is required. AWS Security Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Delegating Role Creation Safely” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this AWS Security Academy lesson?
Yes. Every AWS Security Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- What a Permission Boundary Limits
- Delegating Role Creation Safely
- Organizations, OUs, and SCP Strategy
- How SCPs Combine with IAM Permissions