Advanced

Responding to identity incidents

Contain a compromised account or identity system, evict the attacker, and restore trust.

Many security incidents involve valid credentials: a phished password, a stolen session cookie, a leaked API key, or an abused OAuth consent. Responding well requires knowing every place where access can persist.

Typical identity incidents

IncidentExample
Account takeoverAn attacker signs in with a phished password and approves an MFA prompt.
Session or token theftMalware copies browser cookies or refresh tokens and replays them elsewhere.
Secret leakA cloud access key is committed to a public repository.
Malicious consentA user grants a malicious application access to their mailbox.
Privilege escalationAn attacker adds themselves to an administrative group.
Identity infrastructure compromiseA federation signing key or identity provider admin account is stolen.

Contain: cut every path, not only the password

Resetting a password rarely ends an intrusion by itself. For a compromised user account, consider:

  1. Disable sign-in or block the account temporarily.
  2. Revoke refresh tokens and terminate identity provider and application sessions.
  3. Remove authenticators the attacker registered, such as a new MFA device or passkey.
  4. Revoke OAuth grants and application consents created during the incident.
  5. Rotate API keys, personal access tokens, and secrets the account could read.
  6. Review mailbox rules, forwarding, and delegated permissions.
  7. Reset the password and require re-enrollment through a trusted channel.

See sessions, tokens, and revocation for why each artifact needs its own action.

Scope: what did the identity touch?

Use authentication logs, token issuance logs, and application audit logs to answer:

  • Which accounts and workloads were used, and from where?
  • What changed: group memberships, role assignments, applications, federation settings, policies?
  • Which data and resources were accessed?
  • Were persistence mechanisms created, such as new accounts, credentials, or trusted identity providers?

Attackers who obtain administrative access often add persistence through identity changes. Review recent changes to administrators, application credentials, federation trusts, and conditional access exclusions.

Evict and recover

If identity infrastructure itself was compromised, the response is larger. A stolen token-signing key lets an attacker mint valid tokens for any user, so rotating that key and reestablishing trust with every relying party is required. Plan for this before you need it; see emergency access.

Return to normal operation in stages: restore access for verified users, keep enhanced monitoring, and confirm that the persistence mechanisms are gone.

Learn

After the incident, document the initial access path, which controls failed or were missing, how long each containment step took, and what evidence was unavailable. Common follow-ups include phishing-resistant MFA, shorter token lifetimes, consent restrictions, and better identity logging.

Prepare in advance

  • Runbooks for the common incidents above, including who has authority to disable accounts.
  • Tested ability to revoke sessions and tokens at scale.
  • Identity logs retained long enough for investigation and searchable centrally.
  • An inventory of federation trusts, signing keys, and privileged roles.

References

Knowledge is better when it is shared.Improve this page

Type to search the entire handbook.