AegisAI Perspectives · 203

Compromised mailbox: the first hour in Microsoft 365 and Google Workspace

A timed first-hour table for Microsoft 365 and Google Workspace, with the console path for each step and how long each log is kept.

TL;DR
Answer
For a compromised mailbox, block the account first, then spend the hour removing what the attacker added and saving logs before they age out.
Who it's for
This page is the recovery runbook for a compromised mailbox, for the IT admin who has to act alone.
Watch out for
A password reset alone leaves app passwords, app grants, delegates and forwarding in place, and each one keeps the attacker reading the mail.
What AegisAI does
AegisAI agents read sign-ins and mailbox activity per account and raise one explained finding when behavior stops matching the owner.
Book a demo

AegisAI is review-only today, and automated session revocation is planned next.

Or get the Q3 2026 State of the AI Attack report (free, instant download)

Compromised mailbox: the first hour in Microsoft 365 and Google Workspace

For a compromised mailbox, block the account first, then spend the hour removing what the attacker added and saving logs before they age out.1,7,10,12 AegisAI agents read sign-ins and mailbox activity per account and raise one explained finding when behavior stops matching the owner.22

A mailbox was compromised. What should happen in the first hour?

Cut off access first. Then remove what lets the attacker back in. A password reset alone leaves app passwords, app grants, delegates and forwarding in place, and each one keeps the attacker reading the mail.1,10

Microsoft calls this an account takeover.9 This page is the recovery runbook for a compromised mailbox, for the IT admin who has to act alone. The steps for phishing the account sent to colleagues are in how to stop phishing from a compromised internal account. How the takeover happens is in how email account takeover works. What AegisAI reviews is on the account takeover protection page.

What the attacker leaves behind

A session token is the proof of sign-in a browser or app keeps after the MFA check, so whoever holds it is signed in. An app password is a separate password for an older mail app. An app grant (an OAuth grant) is permission the user gave an outside app to read the mailbox. A delegate is another account allowed to read and send from the mailbox. POP and IMAP are older ways for a mail app to download the whole mailbox. An audit log is the platform's record of who did what.

MITRE ATT&CK has names for four attacker techniques here, Device Registration, Additional Email Delegate Permissions, Email Forwarding Rule and Email Hiding Rules.21 An email hiding rule moves or deletes mail so the owner does not see it. Microsoft lists rules that move mail to Notes, Junk Email or RSS Subscriptions, and odd messages in Sent or Deleted Items, as signs of compromise.1

The first hour, step by step

No source gives minute targets. The two windows below are this page's own ordering, built from the sources. Microsoft says to block access "as soon as possible".1 Access tokens from Microsoft Entra ID (Microsoft's sign-in service) last 1 hour by default.2 Gmail sessions can take up to an hour to end after a cookie reset.11

First 15 minutes (this page's ordering)

Step and whyMicrosoft 365Google Workspace
Block sign-in, so no new session starts.Entra ID > Users > All users > user > Account status > Edit, clear Account enabled2Suspend the user. Suspending also resets sign-in cookies and OAuth tokens10
Revoke sessions, so the stolen sign-in cannot be renewed. Access already issued can last up to 1 hour.User Overview > Revoke sessions2Security > Sign-in cookies > Reset11
Reset the password and delete app passwords, which survive a reset.Authentication methods > Reset password; Multifactor authentication > Manage user settings > Delete all existing app passwords1,3Reset password; Security > Application-specific password, revoke each10,11
Save the sign-in and audit logs. Some are kept only 7 days.Entra ID > Monitoring & health > Sign-in logs, then Audit logs > Download24Reporting > Audit and investigation > User log events and Gmail log events13

Minutes 15 to 60 (this page's ordering)

Step and whyMicrosoft 365Google Workspace
Remove sign-in methods and devices the attacker registered.Entra ID > Users > user > Authentication methods; remove unknown methods or Require re-register MFA; disable registered devices with Get-MgUserRegisteredDevice and Update-MgDevice2,3Security > Passkeys & security keys, Remove; 2-Step Verification > Get backup verification codes > Generate new codes11
Check recovery details, the route back in after a reset.Phone numbers sit under Authentication methods3Security > Recovery information, edit email and phone11
Remove delegates. Send as leaves no sign that a delegate sent the message.Exchange admin center > Recipients > Mailboxes > mailbox > Mailbox delegation4,18No console list. Use the Gmail API delegates resource, or the user removes them17
Revoke apps this user granted, which keep access after a reset.Entra ID > Enterprise apps > app > Permissions > User consent. Revoke with Graph or PowerShell1,5Security > Connected applications, remove each10,11
Remove forwarding and inbox rules.Get-Mailbox Forwarding fields and Get-InboxRule -IncludeHidden1Check the user's forwarding and filters through the Gmail API, or sit with the user and open Gmail settings10
List what the account sent and to whom. Then read Sent Items and Deleted Items.Defender portal > Email & collaboration > Exchange message trace1,8Reporting > Email Log Search, Sender set to the user14

Revoking a Microsoft app grant does not stop the user from consenting again.5 Google says data access returns once a user signs in to the app again.11 The Gmail settings for automatic forwarding and for POP and IMAP apply by organizational unit, and POP and IMAP changes can take up to 24 hours, so they are for hardening later, not for this hour.15,16 The rule hunting detail is in malicious forwarding rules and how to find them. The tenant-wide app consent search is in how to stop OAuth consent phishing.

If the account is synced from on-premises Active Directory, Microsoft says to reset the password there, twice.1,2 Do not email the new password, because the attacker may still read the mailbox.1 If the user is an admin, Microsoft says to review the admin roles assigned to the account.1 If users sign in to Google through a third-party single sign-on service, Google says to end that session before you reset cookies.11

Save the logs before they age out

NIST treats collected incident data as evidence and says to keep it under the organization's preservation and retention rules.19 Some platform logs last only days.

LogKept forSource
Entra ID sign-in and audit logs7 days (Entra ID Free), 30 days (Entra ID P1 and P2)7
Microsoft Purview Audit (Standard)180 days6
Audit (Premium) default policy, users with an E5 licence or the E5 audit add-on1 year for Exchange Online, SharePoint, OneDrive and Entra records6
Google User log events, Gmail log events, OAuth Token log events6 months12
Google Email Log Search30 days, metadata only12, 14

Google admins cannot delete log event data or change how long it is kept.12 The two sources disagree on which licence returns MailItemsAccessed records, the log of which messages were opened. Microsoft says E3 and E5.9 CISA says Premium licences such as E5.18

Who to warn outside the company

NIST says to notify affected third parties as regulation, law and contract require.19 If money moved, the FBI says to contact your bank at once, ask for a recall of the funds and file a complaint at ic3.gov.20 The bank steps are in the first hours of a BEC wire transfer.

The rest is common practice, not a sourced rule. List every outside contact the account wrote to after the first suspicious sign-in, phone each on a number you already hold, and tell them not to act on payment changes from that window.

When to give the account back

Microsoft says to give the account back after the investigation is complete, by resetting the password and then enabling the account. A mailbox that sent spam may need removing from the Restricted entities page.1 Google says to unsuspend the account, issue a temporary password and turn on 2-Step Verification, with security keys preferred over codes.10 No source sets a pass test for returning a compromised mailbox. Common practice, not a sourced rule: give it back once every row above is done and the logs are saved.

What AegisAI does after a takeover

AegisAI is review-only today, and automated session revocation is planned next.23 AegisAI does not revoke sessions today. Every AegisAI finding comes with recommended steps, and your team acts in Entra ID or Google Workspace.22 AegisAI weighs impossible travel, new devices, inbox rule changes and suspicious internal sends together per account.22 The AegisAI page example includes a hidden inbox rule that quietly moves the owner's mail out of sight, so replies about payments never reach them.22 In that example each signal is weak alone. Together, inside 24 minutes, on an account that has never made a rule, they fit a stolen session preparing fraud.22 AegisAI account takeover protection is in early access and runs on the connection you already have, review-only, with no MX change (no change to how mail is routed).22 The Google Workspace side is in account takeover in Google Workspace, the Microsoft side in account takeover protection for Microsoft 365. To see it on your tenant, book a demo.

Questions people ask

How does AegisAI help in the first hour of a compromised mailbox?

AegisAI agents read sign-ins and mailbox activity per account and raise one explained finding. AegisAI is review-only today. Every finding comes with recommended steps, and your team acts in Entra ID or Google Workspace.

A mailbox was compromised. What should happen in the first hour?

In this page's ordering, block sign-in, end sessions, reset the password and save the logs in the first 15 minutes. Then remove sign-in methods, delegates, app grants, forwarding and rules, and list what the account sent.

How do I spot a hijacked mailbox when MFA didn't stop the attacker?

Look at behavior after the sign-in, such as new inbox rules, new forwarding and odd sent mail. AegisAI says MFA stops most of it, but token theft and adversary-in-the-middle kits (phishing pages that sit between the user and the real sign-in page and copy the session) get past it. The full sign table is in how to spot a hijacked mailbox.

Do BEC protection tools disable compromised accounts automatically?

It depends on the tool and the access it holds. Ask each vendor which actions it takes without a person. Microsoft and Google both let an admin disable or suspend the account by hand. AegisAI does not revoke sessions today, and automated session revocation is planned next.

How to identify suspicious mailbox forwarding or auto-reply rules?

In Microsoft 365, run Get-InboxRule with -IncludeHidden and check the mailbox forwarding fields. In Google Workspace, check forwarding through the Gmail API, or ask the user to check Gmail filters and forwarding. The full method is in malicious forwarding rules and how to find them.

What is account takeover?

Microsoft describes it as an attacker who gains access to a user account and operates as the user. In email, the attacker reads and sends mail as that person.

Who must be told when a mailbox is compromised?

Affected third parties, as regulation, law and contract require, and law enforcement under your incident plan. If money moved, your bank at once and the FBI at ic3.gov.

Sources

  1. Microsoft Learn: Respond to a compromised email account in Microsoft 365, updated 19 August 2026, read 3 December 2026
  2. Microsoft Learn: Revoke user access in an emergency in Microsoft Entra ID, 19 June 2026, read 3 December 2026
  3. Microsoft Learn: Manage authentication methods for Microsoft Entra multifactor authentication, updated 2 March 2026, read 3 December 2026
  4. Microsoft Learn: Manage permissions for recipients in Exchange Online, updated 3 August 2026, read 3 December 2026
  5. Microsoft Learn: Review permissions granted to enterprise applications, updated 19 February 2026, read 3 December 2026
  6. Microsoft Learn: Manage audit log retention policies, updated 24 June 2026, read 3 December 2026
  7. Microsoft Learn: Microsoft Entra data retention, updated 25 March 2026, read 3 December 2026
  8. Microsoft Learn: Message trace in the Microsoft Defender portal, updated 24 August 2026, read 3 December 2026
  9. Microsoft Learn: Manage mailbox auditing, updated 22 August 2026; Use MailItemsAccessed to investigate compromised accounts, updated 24 June 2026; read 3 December 2026 (second page: https://learn.microsoft.com/en-us/purview/audit-log-investigate-accounts)
  10. Google Workspace Admin Help: Identify and secure compromised accounts, read 3 December 2026
  11. Google Workspace Admin Help: Manage a user's security settings, read 3 December 2026
  12. Google Workspace Admin Help: Data retention and lag times, read 3 December 2026
  13. Google Workspace Admin Help: User log events; Gmail log events, read 3 December 2026 (second page: https://knowledge.workspace.google.com/admin/reports/gmail-log-events)
  14. Google Workspace Admin Help: Find messages with Email Log Search, read 3 December 2026
  15. Google Workspace Admin Help: Let users automatically forward their own Gmail emails, read 3 December 2026
  16. Google Workspace Admin Help: Turn POP and IMAP on or off for users, read 3 December 2026
  17. Google Workspace Admin Help: Let users delegate access to a Gmail account; Gmail API: Managing delegates, read 3 December 2026 (second page: https://developers.google.com/workspace/gmail/api/guides/delegate_settings)
  18. CISA Eviction Strategies Tool: Audit and Restrict Mailbox Permissions, 14 March 2025, read 3 December 2026
  19. NIST SP 800-61 Rev. 3, Incident Response Recommendations and Considerations for Cybersecurity Risk Management, April 2025, read 3 December 2026
  20. FBI Internet Crime Complaint Center: 2025 IC3 Annual Report, read 3 December 2026
  21. , https://attack.mitre.org/techniques/T1098/002/ , https://attack.mitre.org/techniques/T1114/003/ and https://attack.mitre.org/techniques/T1564/008/ (MITRE ATT&CK: Device Registration; Additional Email Delegate Permissions; Email Forwarding Rule; Email Hiding Rules, read 3 December 2026)
  22. AegisAI: Account takeover protection, read 3 December 2026
  23. AegisAI: Platform, read 3 December 2026
  24. Microsoft Learn: How to download logs in Microsoft Entra ID, updated 26 February 2026, read 3 December 2026

Recent posts

Every email, investigated.