iac.htora.dev · security templates

Home/Refreshers/Incident response on Azure: refresher

Incident response on Azure

What Azure records by default, how to read a caller or a sign-in, and the first moves for each kind of compromise.

Remember

  1. The Activity Log keeps 90 days of writes, deletes, and actions. No reads.
  2. Resource logs, such as blob reads, exist only after a diagnostic setting.
  3. Entra sign-in and audit logs last seven days on Free, and 30 with P1 or P2.
  4. Sign-ins come in four logs: interactive, non-interactive, service principal, managed identity.
  5. A managed identity's tokens are cached for around 24 hours and cannot be refreshed early.

Commands

What one caller changedaz monitor activity-log list --caller <upn or app id> --offset 7d
End a user's sessionsRevoke-MgUserSignInSession -UserId <id>
Keep a VMaz lock create -n incident --lock-type CanNotDelete -g <group> --resource <vm> --resource-type Microsoft.Compute/virtualMachines
Snapshot a diskaz snapshot create -g <group> -n <name> --source <disk id> --tags incident=<id>

Watch out

  • Access tokens outlive a session revoke by about an hour, except in services with continuous access evaluation.
  • Removing a network security group rule leaves open connections running.
  • New credentials on an app keep an attacker in after the user is disabled.
Check it worked

A role assignment made in a sandbox subscription appears in the Activity Log with its caller.

Read the full pageDownload PDF

Registry 0.23.0. Built 2026-11-17.

Made by Habibullah Tora. Source on GitHub. Code under the MIT licence, writing under CC BY 4.0.