Repository navigation
Identity Incident Response
Last reviewed: 2026-11-28 (procedure assembled from provider documentation; not exercised against a real tenant, account or organization)
Caution
Authorized use only. Containment actions in this playbook disable accounts, revoke sessions, remove app access and change trust settings. Use them only in environments you are authorized to respond in, under an incident record, and coordinate with service owners before acting on workload identities. See LEGAL.md.
Prerequisites: Cloud identity index ยท Identity log sources ยท Incident Response index
A cloud identity incident playbook for Microsoft Entra ID, AWS and Google Cloud / Workspace: compromised users, compromised workload credentials, malicious app consent and federation tampering.
Walks through triage, containment, eradication, recovery and lessons learned. Each step links to the detailed, source-cited procedure in the other guides of this section and to the identity detections that can raise the first alert.
End the attacker's access across every provider the identity touches, remove the persistence they added, and restore service with evidence preserved.
- An identity detection fires (role added, consent granted, key created, emergency account used, unexpected federated subject)
- A user reports MFA prompts they did not start, or approving an app they did not expect
- A provider risk signal (Entra ID Protection, Workspace
suspicious_login) marks an account
| Incident type | Typical first signal | Main guide |
|---|---|---|
| Compromised user (password, session or token) | Risky sign-in, impossible-travel style alert, user report | Token theft & session revocation |
| Compromised workload credential | New key or secret, API calls from an unknown network | Token theft & session revocation |
| Illicit OAuth consent | "Consent to application", Workspace authorize
|
OAuth consent & app investigation |
| Privilege escalation in the IdP | "Add member to role", setIamPolicy, CreateAccountAssignment
|
Identity lifecycle & privileged access |
| Federation or trust tampering | "Set federation settings on domain", new OIDC trust | Token theft & session revocation |
For on-premises and endpoint-side unauthorized access (Windows event logs, SSH, brute force), use the unauthorized access playbook alongside this one.
-
Confirm the alert against the raw record. Open the event in the provider log (Entra
AuditLogs/SigninLogs, CloudTrail, Cloud Audit Logs or Workspace reports), not only the SIEM summary. - Identify the identity and its reach. Which human or workload; which tenants, AWS accounts and Google Cloud projects it can reach through federation, Identity Center assignments or service account impersonation.
- Check log availability now. Retention may be short (Entra Free 7 days; CloudTrail event history 90 days per Region; Workspace 6 months). Export what you need before it ages out; see identity log sources.
- Establish a timeline from the first suspicious event: sign-ins (including non-interactive and service principal sign-ins), MFA method changes, consent grants, role and policy changes, new credentials.
-
Classify severity. Treat any privileged role, emergency-access account, federation change or tenant-wide consent (
IsAdminConsentTrue) as critical.
Correlate with endpoint and email evidence through the alert-to-case correlation guide.
Act in this order so the attacker cannot re-enter between steps. Details and limits are in token theft & session revocation.
| Step | Microsoft Entra ID | AWS | Google Cloud / Workspace |
|---|---|---|---|
| Block new sign-ins |
Update-MgUser -UserId <id> -AccountEnabled:$false (hybrid: Disable-ADAccount on-premises first) |
Identity Center: add user ID to the deny SCP; IAM user: remove console password | Suspend the user |
| End sessions |
Revoke-MgUserSignInSession -UserId <id>; disable devices |
Role: Revoke active sessions (AWSRevokeOlderSessions); Identity Center: delete the active session |
users.signOut |
| Disable workload credentials | Remove the service principal secret or certificate; disable a malicious app (do not delete) | aws iam update-access-key ... --status Inactive |
gcloud iam service-accounts keys disable; disable the service account to revoke issued short-lived credentials |
| Remove app access |
Remove-MgOauth2PermissionGrant, Remove-MgServicePrincipalAppRoleAssignment
|
Review OIDC/SAML trusts the attacker added |
tokens.delete per app |
Warning
Every revocation has a residual window: Entra notes a delay of a few minutes for session revocation and does not recall issued access tokens; AWS denies sessions issued before a point about 30 seconds ahead; disabling a Google service account key does not revoke short-lived credentials already issued from it. Keep monitoring through that window.
Remove everything the attacker may have added. Review the full incident window, not just the first alert.
-
Authentication methods: MFA methods, passkeys or phone numbers registered during the window; Workspace
2sv_enroll,passkey_enrolled,recovery_phone_edit,recovery_email_edit. -
Credentials on apps and roles: "Add service principal credentials", "Update application - Certificates and secrets management", "Add owner to application"; CloudTrail
CreateAccessKey(including for other users);CreateServiceAccountKey/UploadServiceAccountKey. -
Privilege: "Add member to role" and PIM eligible assignments; IAM policy attachments (
AttachUserPolicyand similar); Identity CenterCreateAccountAssignmentand permission-set changes;setIamPolicyon projects, folders and organizations. - Policy weakening: Conditional Access policy updates or deletions, named-location changes, security defaults changes.
-
Trust changes: "Set federation settings on domain", "Set domain authentication", "Add unverified domain"; new IAM OIDC providers or role trust policies; Workload Identity Federation pool changes (
WorkloadIdentityPools.SetIamPolicy). If a SAML token-signing key may be exposed, follow the two-certificate emergency rotation. - Mail and data persistence: for Microsoft 365, mailbox rules and forwarding (see the unauthorized access playbook).
- Reset the user's password and require re-registration with a phishing-resistant method; see phishing-resistant authentication.
- Re-enable the account only after eradication is complete, and remove the user ID from the AWS deny SCP no sooner than 12 hours after it was added.
- Issue new workload credentials through federation instead of new long-lived keys where possible; see workload identity federation.
- Rotate any secrets the compromised identity could read (vaults, parameter stores, CI variables).
- Watch the identity closely for at least the longest token or session lifetime in play.
- Which detection fired first, and how long after the initial access? Add or tune a rule for the earliest event you found; the detections show the expected structure and test evidence.
- Were logs missing or expired? Fix diagnostic settings, trails, sinks and retention.
- Did a control fail open (Conditional Access exclusion, broad OIDC
subwildcard, user consent allowed for all apps, long-lived keys)? Record the change and the owner. - Did break-glass work if it was needed? Schedule the next drill; see periodic break-glass testing.
- Update this playbook and the unauthorized access playbook with anything that slowed the response.
- README.md - Cloud identity section index
- detections/README.md - Identity detection rules
- ../../PlayBooks/unauth_access.md - Unauthorized access playbook
- ../README.md - Cloud Security section index
โฌ ๏ธ Cloud Identity index | Master Index | ๐ฏ Role Navigation | Legal Notice
๐ Source: Cloud/Identity/identity-incident-response.md | โ๏ธ Suggest an edit | โฌ
๏ธ Back to Cloud
- ๐บ๏ธ Browse by Topic
- ๐ All Repository Files
- ๐งญ Learning Paths
- ๐ Master Guide
- ๐ค Glossary
- โ๏ธ Legal & Disclaimer
๐ Foundations & Learning
๐ก๏ธ Defense & Investigations
- Incident Response
- Open Source Intelligence (OSINT)
- Reverse Engineering
- Operations Security (OPSEC)
- Compliance
โ๏ธ Platforms & Infrastructure
๐ก Hardware, Wireless & Field Projects
- PNWC Cyberdeck
- Hardware Testing
- Hardware Hacking
- Software-Defined Radio
- Wardriving
- uConsole
- Space Security
๐งฐ Assessment & Field Reference
๐ฆ Downloads & Project Resources
๐๏ธ Additional Topics