Cloud IAM Privilege Escalation
Small permissions that add up to admin
In the cloud, identity is the perimeter. A user who can't do anything dangerous directly may still hold a combination of permissions that lets them borrow a more powerful role. The classic example is being allowed to create a function and "pass" an admin role to it.
Advanced · 5 steps
| Technique | T1098 (Account Manipulation), T1078.004 (Cloud Accounts) |
|---|---|
| Classic combo | iam:PassRole + create/run compute |
| Other paths | Edit own policy, create access keys for others |
| Guardrails | Permission boundaries, SCPs |
| Analysis | IAM Access Analyzer, path-finding tools |
| Principle | Least privilege, no wildcards |
Step by step
A limited foothold Leaked developer credentials
An attacker obtains a developer's access key, perhaps from a laptop or a leaked file. The developer's policy looks safe: no admin rights, no ability to edit IAM. The attacker starts by listing what this identity can do.
The dangerous combination PassRole on any role
iam:PassRolelets a user attach a role to a resource they create. It was granted on*"so deployments don't fail". Combined with permission to create functions, the user can create code that runs with any role in the account, including an admin role.Borrow the admin role Code runs with someone else's rights
The attacker creates a small function, passes
ops-admin-roleto it, and invokes it. The function's code calls IAM to create a new access key for an admin user, which it returns. The developer key has become admin access.Spotted in the audit log Unusual IAM activity
CloudTrail records every API call. Detection rules flag a function created with an admin role by a non-admin identity, and an access key created for an admin user from inside a function. The SOC disables the keys and deletes the function.
Close the path Least privilege with guardrails
PassRole is limited to the specific role the developer's functions need. A permission boundary caps anything the developer creates at their own level, and an organisation policy blocks creating access keys for admin users except through a break-glass process. Path-analysis tools are run regularly to catch new combinations.
How to defend
- Avoid wildcards like iam:* and "Resource": "*" in policies
- Restrict iam:PassRole to specific roles that the user actually needs
- Use permission boundaries so roles a developer creates can't exceed their own rights
- Apply organisation-wide guardrails (SCPs) for actions nobody should take
- Review unused permissions and analyse escalation paths regularly
More in Cloud Security.
Packets
| No. | Time | Source | Destination | Protocol | Info | Size |
|---|