Investigating an account compromise
On Day 2 at 08:50, one alert about Riley's account reaches Quinn. This lesson follows the investigation that grows from it: the questions every account investigation answers, building a timeline by pivoting from one record to the next, telling the attacker's sessionThe ongoing connection between later requests and an earlier sign-in, so you are not asked for your password on every click. It is often tracked with a cookie holding an unpredictable session identifier. from Riley's, widening the scope to other accounts, and capturing evidence before anything is cleaned up.
Starting from one alert
At 08:50 on Day 2, Quinn, on Cedar Inc.'s security team, receives an alert about Riley's account. Riley works in finance and normally signs in from Cedar's office network, 198.51.100.0/24. The alert says that at 09:20 the day before, an authenticator appSomething a person controls and uses to prove control of an account, such as a memorized password, an app that generates one-time codes, or a security key. It counts only after it has been registered to that account. was added to Riley's account from a network the account had never used, six minutes after a sign-in from a hosting provider's network, 203.0.113.0/24.
The alert describes one change. It does not say how the attacker got in, what else they did, or whether they are still inside. An investigation answers those questions from the records. Quinn's first decision is how urgent this is. The account belongs to someone who handles invoices and payments, the change is nearly a day old, and anyone holding a working authenticator for the account may be able to come back whenever they like. Quinn treats it as an active compromise and opens an incident record: a running document of findings, times, decisions and the people involved.
The incident record matters more than it might seem. Investigations involve several people over hours or days, and the responders' own actions, such as ending a session or exporting a mailbox, appear in the same records as the attacker's. Writing down what responders did, and when, is what keeps the two apart later.
Questions an investigation answers
Every account investigation works toward the same four questions:
- How did the attacker get in, and when?
- What did they do and change while inside?
- What access do they still have?
- Who and what else is affected?
Each question points at different records. The first lives in sign-in records: which sign-in started the attacker's session, from where, and with which methods. The second needs the audit history of the account and of the services it reaches, such as method changes, consents, mail rules, and messages read or sent. The third is a list of footholds, everything that would let the attacker return, of the kinds described in How attackers stay in. The fourth turns outward, to other accounts, other systems, and the people and organizations whose information passed through the account.
Throughout, Quinn keeps facts and hypotheses apart. "Session s-7a91 added an authenticator at 09:20 from 203.0.113.57" is a fact taken from a record. "Riley was phished" is a hypothesis until the records, or Riley, confirm it. Writing hypotheses down as hypotheses stops an early guess from quietly becoming the conclusion.
Building a timeline
A timeline puts every relevant event in one sequence. Quinn builds it by pivoting: starting from one known value in the alert and searching for every record that shares it. The authenticator was added by session s-7a91, so Quinn searches for that session. It was created by a sign-in at 09:14 on Day 1 from 203.0.113.24, which passed both the password and the authenticator-code checks. Later that morning, the same session approved a third-party app called Invoice Sync.
Each finding gives new values to pivot on. The app's client ID leads to the mail service's records of what Invoice Sync read. The attacker's network leads to a mail rule created from 203.0.113.57. Searching the help desk's tickets from that morning turns up a refused call from a supposed IT contractor on Cedar's mail migration, a project discussed at length in Riley's mail. Request IDs connect records that different services wrote for the same request, and synchronized clocks let records from different systems sit in one trustworthy order, as Recording identity activity explains.
Combined with what Riley later remembered, the records give this timeline:
Day 0
A wave of guesses using a few common passwords hits hundreds of Cedar accounts over a morning, from three networks. Sign-in limits slow it down, and nothing succeeds. Quinn finds no successful sign-in from the wave.
Day 1, 09:02
Riley receives an email about a shared invoice. Its link leads to a relay page at
login-cedar.example, a look-alike of Cedar's sign-in.Day 1, 09:14
Riley enters a password and an authenticator-app code on that page. The relay passes both to Cedar's identity provider, which records a successful sign-in from 203.0.113.24 and issues session
s-7a91. The relay keeps the session cookieA small value that a website asks the browser to store and send back with later matching requests. Cookies commonly carry a session identifier, so the site can recognize an ongoing sign-in without your password..Day 1, 09:20
From 203.0.113.57, session
s-7a91registers a new authenticator app, passing a recent sign-in check that a minutes-old stolen session always passes.Day 1, 09:31
The same session approves Invoice Sync to read and send mail as Riley.
Day 1, 09:40
A mail rule appears that forwards messages containing "invoice" to an outside address.
Day 1, 10:05
A caller posing as an IT contractor asks Rowan, on the help desk, to reset MFASigning in with more than one type of factor, such as a password plus a code from an enrolled authenticator app. Two passwords are still one factor type, however many screens they appear on. on an administrator's account. A callback to the administrator shows they made no such request, and Rowan refuses and records it.
Day 1, 11:30
Invoice Sync reads an email from Cedar's payments vendor that contains an APIAn application programming interface: a defined way for software to interact with a service. A web API offers endpoints where other programs send HTTP requests. key.
Day 2, 08:50
The alert fires.
The timeline also shows what did not happen: no password change, no change to recovery settings, no new role. The 11:30 read leaves the identity system altogether, because a key for the payments vendor now has to be treated as exposed. Rotating credentials and keys after exposure follows that thread further.
Security teams describe steps like these in the shared vocabulary of MITRE ATT&CK, the public catalog of attack techniques that Identity telemetry and detection queries used to label its queries. Writing the timeline in its terms lets Quinn compare Cedar's incident with published reports, check which techniques Cedar's detection rules cover, and share what was learned with others in a form they can search:
| When | What happened | ATT&CK technique |
|---|---|---|
| Day 0 | A few common passwords tried against hundreds of accounts | T1110.003 Brute Force: Password Spraying |
| Day 1, 09:02 | An email links to the look-alike sign-in page | T1566.002 Phishing: Spearphishing Link |
| Day 1, 09:14 | The relay passes Riley's password and code to Cedar and keeps the session cookie | T1557 Adversary-in-the-Middle; T1539 Steal Web Session Cookie |
| Day 1, 09:20 | The stolen session is used from another network | T1550.004 Use Alternate Authentication Material: Web Session Cookie |
| Day 1, 09:20 | The attacker registers an authenticator app of their own | T1098.005 Account Manipulation: Device Registration |
| Day 1, 09:31 | Invoice Sync is approved to read and send mail | T1528 Steal Application Access Token |
| Day 1, 09:40 | A rule forwards invoice mail outside Cedar | T1114.003 Email Collection: Email Forwarding Rule |
| Day 1, 10:05 | A caller impersonates an IT contractor to the help desk | T1656 Impersonation |
| Day 1, 11:30 | Invoice Sync reads the email holding the vendor's API key | T1114.002 Email Collection: Remote Email Collection |
Read down the right-hand column and Cedar's coverage becomes visible. Only the combination at 09:20 raised an alert, and nearly a day late. The mail rule, the app consent and the help desk call each had a technique name and no rule watching for it.
Telling the attacker from the owner
Every record in that timeline names the same actor: Riley's account. And while the attacker worked, Riley was working too, from the office, in a session that started at 08:41. The identity provider cannot tell people apart, only sessions, so Quinn separates them by the evidence around each event: the session ID, the network, the device and the time.
Riley's session, s-2b64, started at 08:41 from 198.51.100.24 on Riley's usual laptop and stayed there all day. Session s-7a91 started at 09:14 from the relay's address and was then used from 203.0.113.57, on a device that had never signed in to Cedar before. Every change that worried Quinn belongs to s-7a91. Some records are less clear. The mail service recorded the rule created at 09:40:17 with the account and the network, but no session, so Quinn attributes it by network and timing and notes in the incident record that the attribution is an inference. The figure sets the three side by side.
Session s-2b64
- Started
- 08:41
- Network
- 198.51.100.24
- Device
- Riley's usual laptop
- Changes
- None of them
Riley
Session s-7a91
- Started
- 09:14
- Network
- 203.0.113.24, then 203.0.113.57
- Device
- Never seen at Cedar
- Changes
- Authenticator, Invoice Sync
The attacker
Mail rule, 09:40:17
- Started
- No session recorded
- Network
- 203.0.113.57
- Device
- Not recorded
- Changes
- Forwarding rule
The attacker, by inference
The identity provider cannot tell people apart, only sessions.
The quickest way to resolve doubt is to ask the owner, through a channel the attacker cannot read. Quinn does not email Riley, because the attacker can read Riley's mail and a rule is already copying some of it elsewhere. Quinn avoids chat for the same reason: it is reached through the same account. Instead, Quinn calls Riley's desk phone, using the number in Cedar's directory, and then walks over to talk in person. Riley remembers the invoice email, a page that asked for a code, and then an ordinary page that never showed the invoice. Riley did not add an authenticator or approve any app.
Memories are imperfect, and people can feel embarrassed about having followed a link. Quinn asks what happened, not who was at fault. A relay page is built to be indistinguishable from the real one, as Phishing and relayed sign-ins explained. Riley's description of the morning confirms Quinn's hypothesis, and the records confirm Riley's description.
Following the trail to other accounts
An attacker who phished one person rarely stops at one. Quinn widens the investigation's scope along every thread the timeline offers:
- The invoice email: who else received it, and whether any other account signed in from the relay's address.
- The attacker's network: any other account with sign-ins or session use from 203.0.113.0/24.
- Invoice Sync: any other account that approved the same app, found by its client ID.
- The help-desk call: the administrator the caller named, checked for sign-ins, method changes and recovery attempts, and warned directly.
- The vendor key: what it allows, and whether the vendor's records show it being used from anywhere other than Cedar's own network addresses.
- The mail itself: which vendors and customers had messages forwarded out, and whether anything was sent in Riley's name.
Quinn finds the same email in four other finance mailboxes. None of those accounts shows a sign-in from 203.0.113.0/24, and nobody else approved Invoice Sync. The administrator's account shows no change since the refused call. That leaves Riley's account, the forwarded mail and the vendor key within scope. Quinn records this as the current scope rather than a final answer, because new evidence can still widen it.
You can work through Quinn's records yourself. Each step shows the kind of record an investigator reads, and asks the next question in turn.
Investigate the Cedar incident
Simulation. These records are made up for this exercise. Work through them as Quinn did, one question at a time; answering sends nothing anywhere.
Before anything is cleaned up
Once the footholds are known, the urge is to remove them at once. Quinn first captures what cleanup would destroy. Revoking Invoice Sync's access can remove the record of which permissions it held. Deleting the mail rule removes its forwarding address. Removing the attacker's authenticator removes its registration details. Quinn exports the relevant sign-in records, audit entries, the mail rule, the app's details and the phishingTricking someone, usually with a message and a look-alike sign-in page, into handing over the evidence that opens their account, such as a password or a one-time code. email into the incident record, and asks for those records to be kept beyond their normal retention period so they cannot age out mid-investigation.
Preservation is no reason to leave an attacker working. When harm is ongoing, capturing the essentials takes minutes, not days, and containment follows straight after. At Cedar, mail was still being forwarded, so Quinn captured the records quickly and moved on to containment the same morning.
There is a second reason to wait until the list of footholds is complete. Removing them one at a time warns an attacker who still holds the others. Reset Riley's password alone, and the attacker's authenticator, the app's access and the mail rule all keep working, and the attacker, now alerted, may add another foothold before anyone notices. Containment works best as one planned action that removes everything together.
Check your understanding
Try these questions before moving on. If an answer isn't right, use the feedback and try again.
Try it in the Lab
- Build a timeline from a reported session and preserve itStage a session that connects an app and is then reported, pivot from the alert by subject and session, separate the two sessions, widen the scope and hold the evidence.