Collect Microsoft cloud evidence
PowerShell-based collection for tenant and user investigation packages that support account-compromise and BEC analysis.
A structured investigation workflow for collecting Microsoft 365 evidence, reconstructing identity and user activity, checking persistence, and determining whether related activity extends into Azure or AWS.
The workflow starts with Microsoft 365 evidence and expands only when the identity, IP, application, session, or timeline creates a defensible reason to investigate Azure or AWS.
PowerShell-based collection for tenant and user investigation packages that support account-compromise and BEC analysis.
Review sign-ins, risk, MFA, Conditional Access, devices, applications, service principals, and identity changes.
Search the Unified Audit Log for user, administrator, mailbox, file, application, and collaboration activity.
Correlate activity across Exchange Online, SharePoint, OneDrive, Teams, and other audited Microsoft 365 workloads.
Review Azure Activity, resource changes, role assignments, virtual machines, network controls, and relevant diagnostic logs.
Review CloudTrail, IAM, EC2, security groups, console access, API events, and source-IP or identity overlaps.
Record the incident trigger, authorized tenant, affected identity, investigation window, timezone, assigned analyst, data-retention limits, and evidence location. Preserve original exports and record collection time before analysis.
Use Hawk to collect Microsoft cloud investigation artifacts, then preserve the output as read-only source evidence. Document modules, account permissions, collection start/end times, errors, and missing datasets.
# Representative authorized-lab collection sequence
Install-Module -Name Hawk -Scope CurrentUser
Import-Module Hawk
Start-HawkTenantInvestigation
Start-HawkUserInvestigation -UserPrincipleName user@tenant.exampleReview interactive and non-interactive sign-ins, source IPs, location, device state, user agent, application, authentication detail, MFA result, Conditional Access, risk, session identifiers, role changes, credential changes, device registrations, and application consent.
SigninLogs
| where TimeGenerated between (datetime(START_TIME) .. datetime(END_TIME))
| where UserPrincipalName =~ "user@tenant.example"
| project TimeGenerated, UserPrincipalName, IPAddress, Location,
AppDisplayName, ClientAppUsed, AuthenticationRequirement,
ConditionalAccessStatus, ResultType, CorrelationId
| order by TimeGenerated ascSearch the Unified Audit Log by user, operation, workload, IP, object, and time. Review Exchange mailbox activity, inbox rules, forwarding, delegates, Send/SendAs, searches, file access, sharing, downloads, Teams activity, application consent, and administrator changes.
Search-UnifiedAuditLog `
-StartDate $StartUtc `
-EndDate $EndUtc `
-UserIds "user@tenant.example" `
-ResultSize 5000Convert timestamps to UTC and correlate Entra sign-ins, UAL records, Hawk exports, mailbox actions, application activity, source IPs, correlation IDs, user agents, objects, and session context. Separate confirmed evidence from inference.
For Azure, review resource changes, role assignments, service principals, virtual-machine operations, network security groups, and diagnostic data. For AWS, review CloudTrail event history, console sign-ins, IAM changes, access-key activity, EC2 actions, and security-group modifications. AWS is a separate evidence source unless an actual identity, IP, application, or timeline relationship is demonstrated.
AzureActivity
| where TimeGenerated between (datetime(START_TIME) .. datetime(END_TIME))
| where Caller has "user@tenant.example" or CallerIpAddress == "SOURCE_IP"
| project TimeGenerated, OperationNameValue, ActivityStatusValue,
Caller, CallerIpAddress, ResourceGroup, ResourceIdaws cloudtrail lookup-events \
--lookup-attributes AttributeKey=Username,AttributeValue=LAB_USER \
--start-time START_TIME --end-time END_TIME --output jsonRevoke sessions, reset credentials, review MFA methods, remove malicious mailbox rules, delegates or application consent, and disable affected identities when required. If cloud impact is confirmed, rotate exposed keys, remove unauthorized role assignments, restrict network access, preserve affected resources, and validate recovery.
Document incident details, executive summary, scope, evidence sources, timeline, findings, indicators, affected identities and resources, containment, eradication, recovery, root cause, limitations, and final status. Attach hashes or filenames for exported evidence and distinguish observed facts from analyst assessment.
Which sign-in or account change established unauthorized access, and what authentication controls were involved?
What mailbox, file, collaboration, application, or administrator actions occurred after the suspicious session?
Was related Azure or AWS activity actually observed, or did evidence support keeping the incident limited to Microsoft 365?