IAM Privilege Escalation Detection
cloud-audit detects 25 IAM privilege escalation methods across 6 categories. This goes beyond static policy analysis -- it resolves actual escalation paths by combining IAM policies, trust relationships, and resource permissions.
How It Works
- Calls
GetAccountAuthorizationDetailsto pull all IAM policies, roles, users, and groups - Resolves effective permissions per principal (inline + attached + group policies)
- Walks escalation paths: can this principal reach admin through any sequence of allowed actions?
- Reports each path with the specific escalation method and affected principal
No additional permissions beyond iam:GetAccountAuthorizationDetails and iam:SimulatePrincipalPolicy are required. The check is read-only.
Categories
1. IAM Self-Mutation (8 methods)
The principal can modify its own permissions to grant itself admin access.
iam:CreatePolicyVersion- create new version of an attached policyiam:SetDefaultPolicyVersion- set a different policy version as defaultiam:AttachUserPolicy- attach managed policy to selfiam:AttachRolePolicy- attach managed policy to a roleiam:AttachGroupPolicy- attach managed policy to own groupiam:PutUserPolicy- attach inline policy to selfiam:PutGroupPolicy- modify group the principal belongs toiam:PutRolePolicy- attach inline policy to a role
2. Credential Access (4 methods)
The principal can obtain credentials for a more privileged identity.
iam:CreateAccessKey- create access keys for another useriam:CreateLoginProfile- set console password for another useriam:UpdateLoginProfile- reset another user's passwordiam:AddUserToGroup- add self to a more privileged group
3. PassRole + Service (6 methods)
The principal can pass a privileged role to an AWS service that executes code.
- PassRole + Lambda (
lambda:CreateFunction+lambda:InvokeFunction) - PassRole + EC2 (
ec2:RunInstances) - PassRole + ECS (
ecs:RegisterTaskDefinition+ecs:RunTask) - PassRole + Glue (
glue:CreateJob) - PassRole + CloudFormation (
cloudformation:CreateStack) - PassRole + DataPipeline (
datapipeline:CreatePipeline)
4. Lambda Code Modification (2 methods)
The principal can modify existing Lambda function code to inject commands.
lambda:UpdateFunctionCode- replace function code directlylambda:UpdateFunctionConfiguration+ layers - inject via Lambda layer
5. Trust Policy Abuse (1 method)
The principal can modify role trust policies to allow itself to assume privileged roles.
iam:UpdateAssumeRolePolicy- rewrite the trust policy
6. Permission Boundary Bypass (4 methods)
The principal can remove or modify permission boundaries that restrict its effective permissions.
iam:DeleteRolePermissionsBoundary- remove boundary from an assumed roleiam:DeleteUserPermissionsBoundary- remove own boundaryiam:PutRolePermissionsBoundary- replace role boundary with a permissive oneiam:PutUserPermissionsBoundary- replace own boundary with a permissive one
Attack Chain Integration
Escalation paths feed into three attack chains:
| Chain | Description |
|---|---|
| AC-34 | PassRole Escalation to Admin |
| AC-35 | Self-Escalation via IAM Policy Modification |
| AC-36 | External Escalation via OIDC + Privilege Escalation |
When an escalation path is detected, it is reported as check aws-iam-018 and also triggers the relevant attack chain if the prerequisite conditions are met.
CLI
cloud-audit scan # includes escalation detection
cloud-audit list-checks --id aws-iam-018 # show check details
Escalation findings include the principal ARN, the escalation method, and the target privilege level in the finding details.