Join our Newsletter — 33% off our NHI Course
Home› Guides› Cloud Privilege Escalation Incident Playbook: Contain IAM Changes,…
Template Incident Response & Forensics

Cloud Privilege Escalation Incident Playbook: Contain IAM Changes, Remove Persistence and Roll Back Safely

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 13 November 2026 13 min read
On this page

When an identity in your cloud grants itself more power, every minute spent debating ownership lets the attacker add another role, key or trust relationship that survives your first clean-up. Cloud privilege escalation rarely needs an exploit: a user or workload with permission to attach a policy, edit a trust policy, create a key for a service account or assign a role can lift itself to administrator using ordinary control plane calls. This playbook is a ready-to-adopt response procedure for AWS, Microsoft Azure and Entra ID, and Google Cloud (platforms are listed alphabetically), covering triage, containment, persistence hunting, rollback and recovery. It is for incident responders, cloud platform teams and identity engineers, and it sits under your wider plan in the Cloud Incident Response Guide. Replace the bracketed placeholders with your own values.

How to use this template

  • Adopt sections 1 to 10 as written, then fill the [Organisation] placeholders, contact rotas and log locations in a tabletop before you need them.
  • Pair it with a credential playbook. If the escalation started from a leaked key, run the Leaked Credential Response Playbook in parallel; this playbook owns the IAM changes made after the credential was used.
  • Pre-stage the access. Responders need a break-glass role in every account, subscription and project that can read logs and change IAM, and that is excluded from the guardrails you will apply in containment.
  • Test it twice a year against a sandbox account using the scenarios in section 9, and record the time to each milestone in section 8.

1. Purpose

This playbook defines how [Organisation] detects, contains, investigates and recovers from unauthorised privilege escalation in its cloud environments, so that the attacker loses all elevated access, every persistence mechanism is found and removed, and legitimate IAM configuration is restored from a known good baseline.

2. Scope

  • In scope: AWS accounts in [AWS Organization ID], Azure subscriptions and management groups under tenant [Tenant ID], Microsoft Entra ID directory roles and application permissions, and Google Cloud projects and folders under [Organisation node].
  • Identities: human users, federated sessions, IAM roles, Entra service principals and managed identities, Google service accounts, and AI agents or automation acting with any of these.
  • Out of scope: host-level escalation inside virtual machines or containers (use the Linux Privilege Escalation Techniques Guide and Kubernetes Cluster Compromise Playbook), except where it yields cloud credentials.

3. Escalation paths this playbook covers

Use the table to recognise what happened and which ATT&CK technique to record in the case. All technique IDs are from ATT&CK Enterprise v20.

PathTypical control plane signalATT&CK
Attach or write an admin policy on own user, group or roleAWS AttachUserPolicy, AttachRolePolicy, PutRolePolicy, AddUserToGroup; new default version via CreatePolicyVersion or SetDefaultPolicyVersionT1098.003 Additional Cloud Roles
Create a new role and pass it to computeAWS CreateRole then CreateFunction or RunInstances using that role (iam:PassRole is checked inside these calls, not logged as its own event)T1098.003, T1136.003 Cloud Account
Edit who can assume a privileged roleAWS UpdateAssumeRolePolicy; Entra federation or domain changesT1484.002 Trust Modification
Add credentials to an existing privileged identityAWS CreateAccessKey, CreateLoginProfile, UpdateLoginProfile; Entra "Add service principal credentials"; Google CreateServiceAccountKeyT1098.001 Additional Cloud Credentials
Assign a directory or resource roleEntra "Add member to role" or "Add eligible member to role"; Azure Microsoft.Authorization/roleAssignments/write; Google SetIamPolicyT1098.003
Grant an application permission or consentEntra "Add app role assignment to service principal", "Consent to application", "Add owner to application"T1098.003, T1528 Steal Application Access Token
Abuse impersonation or just-in-time elevationGoogle GenerateAccessToken on a service account; Entra PIM activation; Azure elevate access to User Access Administrator at root scopeT1548.005 Temporary Elevated Cloud Access
Remove the guardrail firstAWS DeleteRolePermissionsBoundary or DeleteUserPermissionsBoundary; detaching an SCP; deleting a Google deny policyT1098.003

The attacker's starting identity is usually a valid cloud account (T1078.004 Cloud Accounts). For how to find these paths before an attacker does, see How to Find IAM Privilege Escalation Paths in AWS.

4. Roles and responsibilities

RoleOwnerResponsibilities in this playbook
Incident commander[Name / rota]Declares severity, approves containment that affects production, owns the decision log
Cloud IAM lead[Name / rota]Executes revocation, guardrails and rollback; holds break-glass access
Cloud forensics analyst[Name / rota]Preserves logs, builds the timeline, hunts persistence
Service owner[Per affected workload]Confirms which roles and keys are legitimate, accepts outage risk
Legal and privacy[Name]Assesses notification duties if data access is confirmed

For a printable version of these roles, use the Incident Response Role Cards Template.

5. Triage (first 30 minutes)

  1. Confirm the change is unauthorised. Match the IAM event to a change ticket, pipeline run or PIM request. No match within 15 minutes means treat it as hostile.
  2. Identify the actor identity and its source. Record the principal ARN, object ID or service account email, session or token issue time, source IP, user agent and, for AWS, the access key ID.
  3. List what was granted. Every policy, role, key, credential, trust edit and consent issued by that actor in the window. The escalated identity is now a second compromised identity.
  4. Size the blast radius. What the escalated identity can reach now: accounts, subscriptions, projects, key vaults, data stores, logging configuration.
  5. Assign severity. Severity 1 if the identity reached organisation, tenant or management group administration, can change logging, or touched production data stores.

6. Containment (by priority)

Contain in this order: stop the elevated sessions, freeze further IAM change, then remove the grants. Removing a policy while the attacker still holds a live session lets them put it back.

6.1 Stop active sessions and credentials

  • AWS roles: revoke active sessions on each affected role. The IAM console's Revoke active sessions action attaches an inline policy named AWSRevokeOlderSessions that denies all actions for sessions whose aws:TokenIssueTime is before the revocation time. It needs iam:PutRolePolicy, affects every user of the role, cannot be used on service-linked roles, and does not touch long-term IAM user keys. Sessions from IAM Identity Center permission sets are revoked in Identity Center instead.
  • AWS users and keys: set new or suspicious access keys to Inactive (UpdateAccessKey) before deleting, so you keep the key ID for log searches, and remove any new console password.
  • Entra ID: revoke the user's sign-in sessions, disable the account, and remove credentials added to service principals in the window.
  • Google Cloud: disable added service account keys and the service account itself if it is not business critical. Disable rather than delete: a deleted and recreated account is a new identity and existing bindings break.

6.2 Freeze further IAM change

  • AWS: attach a pre-written containment SCP to the affected account or OU that denies iam:*, organizations:*, sts:AssumeRole into privileged roles and cloudtrail:StopLogging or DeleteTrail, with an exception for the responder role ARN. SCPs do not apply to the management account or to service-linked roles, so a compromise of the management account needs direct IAM action.
  • Azure and Entra: remove standing role-assignment rights from the actor; require PIM approval for Privileged Role Administrator and User Access Administrator for the duration; check whether anyone has elevated access to User Access Administrator at root scope and switch it off.
  • Google Cloud: apply an IAM deny policy at the folder or project that denies IAM policy changes and service account key creation to all principals except the responder group. Deny policies are evaluated before allow policies, so the actor's grants do not override them.

6.3 Remove the attacker's grants

  • Detach every policy, role assignment, app role and group membership the actor added. Restore the prior default policy version where CreatePolicyVersion was used.
  • Revert trust policy edits and delete roles the actor created, after exporting them as evidence.
  • Remove app consents and owners added in the window. The Midnight Blizzard breach shows why: the actor used a legacy test OAuth application to grant itself the Exchange Online full_access_as_app role and created further applications under its control.

6.4 Decision points for the incident commander

DecisionChoose the faster, disruptive option whenChoose the slower, targeted option when
Revoke all sessions of a shared role or only the actor'sThe role is administrative, or the actor's session cannot be told apart from othersThe role serves production traffic and the attacker's session is clearly identified by source and issue time
Account-wide IAM freeze or per-identity removalMore than one identity was escalated, or the actor could change loggingA single grant was made, it is already removed and logs show no follow-on use
Disable a privileged service account or workload identityIt holds new credentials you cannot account forIts owner confirms all credentials and the outage cost is high; rotate instead and monitor

Record every decision, the person who made it and the evidence it rested on in the decision log.

Rollback of containment: containment SCPs and deny policies are reversible by detaching them. Record each one with its attach time in the decision log and remove them only after section 7 is complete.

7. Investigation and persistence hunt

  1. Preserve evidence first. Export AWS CloudTrail (management events, all regions, organisation trail), Entra audit and sign-in logs, Azure Activity Log, and Google Cloud Admin Activity audit logs to a separate evidence account. Google Admin Activity logs are always written and cannot be disabled; Data Access logs are off by default for most services, so their absence is not proof of no data access.
  2. Build the timeline from the first use of the original credential to the last action of every identity the actor touched, including role chains. See AWS Role Chaining Detection.
  3. Hunt for persistence using the checklist below across every region and every account the escalated identity could reach, not only where you saw activity.
  4. Check data access on stores the escalated identity could read, then hand findings to legal and privacy.
Persistence to look forAWSAzure and Entra IDGoogle Cloud
New identitiesCreateUser, CreateRoleNew users, applications and service principalsNew service accounts
Extra credentialsCreateAccessKey, CreateLoginProfileAdd service principal credentials, federated credentialsCreateServiceAccountKey
Trust changesUpdateAssumeRolePolicy, new OIDC or SAML providersFederation and domain changes, new owners on appsWorkload identity pool and provider changes
Compute carrying privilegeLambda functions or instances with new roles, in every enabled regionAutomation runbooks and managed identities with new role assignmentsCloud Functions or VMs running as a privileged service account
Guardrail removalDeleted permissions boundaries, detached SCPs, stopped trailsChanged diagnostic settings, removed PIM requirementsDeleted deny policies, changed log sinks

The .env cloud extortion campaign is the pattern to expect: the actor used an exposed key to create a role named lambda-ex, attached the AWS managed AdministratorAccess policy and deployed a Lambda function to every other enabled region almost at once. A hunt limited to the home region would have missed most of it.

8. Recovery and rollback

  1. Restore IAM from a known good baseline, ideally the infrastructure as code state before the first malicious event. Diff the live state against it and review every difference with the service owner.
  2. Rotate secondary credentials the escalated identity could read: secrets manager values, key vault secrets, database passwords and CI tokens.
  3. Fix the root path. Remove the permission that allowed the escalation (for example iam:PassRole on *, roles/iam.serviceAccountTokenCreator at project level, or Application Administrator held by a workload).
  4. Lift containment guardrails one at a time, watching for errors and for reappearing grants.
  5. Close with a review within 10 working days that updates this playbook and the detection rules.
MilestoneTargetMeasured from
Escalation event to alert[15 minutes]IAM event time
Alert to sessions revoked[30 minutes]Alert time
Alert to IAM change frozen[60 minutes]Alert time
Persistence hunt complete, all regions[24 hours]Declaration
IAM restored to baseline[72 hours]Declaration

9. Detection and exercises

  • Alert on high-risk IAM events in all three clouds: the events in section 3, plus any IAM change by an identity that has never made one, any IAM change from outside your CI/CD and IaC pipelines, and any Azure elevate access event (Entra audit service "Azure RBAC (Elevated Access)").
  • Exercise scenarios: a CI role attaches AdministratorAccess to itself; a developer adds a client secret to a privileged service principal; a Google service account with Token Creator at project level impersonates the deploy account.
  • Metrics: median time from escalation event to revocation; percentage of privileged IAM changes that came through the pipeline; number of identities able to change IAM, per account; percentage of accounts with the containment SCP or deny policy pre-staged; persistence items found after the first clean-up (target zero).

10. Framework mapping

FrameworkReferenceHow this playbook meets it
NIST CSF 2.0DE.CM-03, RS.AN-03, RS.MA-01, RC.RP-01, PR.AA-05Monitoring of IAM activity, root cause analysis, plan execution, recovery, entitlement review
NIST SP 800-53 Rev. 5IR-4, AU-6, AC-2(4), AC-6(5), CM-3Incident handling, log review, automated audit of account actions, privileged account limits, change control
NIST SP 800-61 Rev. 3Incident response as a CSF 2.0 profilePreparation, response and lessons learned in sections 5 to 9
MITRE ATT&CK v20T1078.004, T1098.001, T1098.003, T1136.003, T1484.002, T1548.005Section 3 classification

Implementation guidance

  • Start with the break-glass and containment artefacts: a responder role per account, the containment SCP, the Google deny policy and the Entra revocation steps, written and tested in a sandbox before anything else.
  • Small organisations with one AWS account or one subscription can skip SCPs and use a permissions boundary on all non-responder roles plus direct revocation. Larger estates should centralise logs in a security account and run the hunt queries across the organisation.
  • Prevention reduces the playbook's use: shrink the set of identities that can change IAM, use just-in-time elevation for people, and keep workloads off IAM write permissions. See the Least Privilege Techniques Guide and the AWS IAM Policies and Roles Guide.
  • Common failure patterns: deleting keys before recording their IDs; removing the policy but not revoking sessions; hunting only the home region; trusting a deny that does not cover the management account; restoring IAM by hand instead of from code, which reintroduces drift.

Standards and references

Related NHI Mgmt Group resources: Cloud Incident Response Guide · How to Investigate CloudTrail for a Compromised Access Key · AWS STS and AssumeRole Guide · Google Cloud IAM and Service Accounts Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 13 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.