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
- The Activity Log keeps 90 days of writes, deletes, and actions. No reads.
- Resource logs, such as blob reads, exist only after a diagnostic setting.
- Entra sign-in and audit logs last seven days on Free, and 30 with P1 or P2.
- Sign-ins come in four logs: interactive, non-interactive, service principal, managed identity.
- A managed identity's tokens are cached for around 24 hours and cannot be refreshed early.
Commands
| What one caller changed | az monitor activity-log list --caller <upn or app id> --offset 7d |
| End a user's sessions | Revoke-MgUserSignInSession -UserId <id> |
| Keep a VM | az lock create -n incident --lock-type CanNotDelete -g <group> --resource <vm> --resource-type Microsoft.Compute/virtualMachines |
| Snapshot a disk | az 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.