Containing and recovering
By mid-morning on Day 2, Quinn knows every way the attacker can reach Riley's account. This lesson follows Cedar Inc.'s response from there: cutting off access in the right order, removing every way back, giving the account to the verified owner, repairing what cannot simply be reversed, watching for a return and learning from the incident without blame.
Cutting off access
By mid-morning on Day 2, Quinn, on Cedar Inc.'s security team, knows what happened to Riley's account in finance. On Day 1, an attacker relayed Riley's password and authenticatorSomething 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. code through a fake sign-in page and kept the 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. that Cedar's identity providerA service that authenticates users and tells other applications about the sign-in, so those applications never handle the users' passwords. In OpenID Connect it is called an OpenID Provider. issued. With that session, they registered their own authenticator app, approved an app called Invoice Sync to read and send Riley's mail, and created a rule forwarding messages about invoices to an outside address. They still know Riley's password.
Containment stops the attacker's access before anything else is repaired. The order matters, because the attacker holds several ways in at once. With Riley's password and their own authenticator, they can complete a fresh sign-in whenever they like. Invoice Sync reads mail with its own refresh tokenA longer-lived credential that a client sends to the authorization server, never to an API, to get new access tokens without asking the person again., and the mail rule needs no sign-in at all. Remove one of these and the others keep working, and an attacker who notices one door closing tends to open another.
Cedar removes them together, in one short planned window:
Blocking new sign-ins comes first, because ending sessions while the attacker can still sign in only invites them to start another. With sign-in blocked, Cedar ends every session on the account, revokes Invoice Sync's access and the tokens issued under it, then removes the attacker's authenticator and the mail rule and checks the recovery settings for anything else that changed. Only then does Riley get the account back. Blocking sign-in also locks Riley out for a while, so Quinn tells Riley in person before it starts.
The dotted shortcut, resetting only the password, is the fix people reach for first, and it would have left the attacker most of their access. Some providers end sessions and app grants when a password changes and some do not, but none removes an authenticator or a mail rule the attacker added. The mail rule kept forwarding whatever the password was. The authenticator was a smaller worry once the password changed, because Cedar asks for the password first, but it would have let the attacker straight back in the moment they learned the new one.
Removing every way back
The list of footholds comes from the investigation, and for a taken-over account it is usually longer than people expect. How attackers stay in describes each kind. A complete cleanup checks for:
- sessions at the identity provider, and in each application that keeps its own session after sign-in;
- refresh tokens and app grants, which survive a password change on many systems;
- added sign-in methods: authenticator apps, passkeys, security keys and phone numbers;
- recovery settings, such as a changed recovery address or phone number;
- app passwords and personal access tokens, which skip the sign-in page entirely;
- mail rules, forwarding settings and mailbox delegates;
- roles, group memberships and configuration the account was able to change.
Each kind of access ends differently, as Revoking access and sharing security events explained. Ending Riley's session at the identity provider does not end a session that an application created after Riley signed in. That application has to be told, either directly or through a security event it receives, and an access tokenA token that a client presents to an API to use access it has been granted, usually limited in what it allows and how long it lasts. It authorizes API calls; it does not tell the client who signed in. it already accepted may keep working until it expires. Quinn checks each application Riley uses, not just the identity provider.
An added passkeyA credential that your phone, computer or password manager creates for one website and keeps for you, unlocked with a fingerprint, face or PIN. Nothing you could type is sent, and it works only for the site it was made for, which helps it resist phishing. or security keyA small physical device, plugged in or held near a phone or computer, that holds credentials and uses them to prove you have it. It is an authenticator that resists phishing. deserves particular attention, because it can complete a sign-in with no password at all. Had the attacker registered a passkey instead of an authenticator app, a password reset would not have slowed them down for a moment. Any method Riley does not recognize goes. Cedar goes further and removes every method on the account, so that Riley enrolls again from scratch and nothing is left that anyone has to reason about.
Some footholds reach beyond one account. Cedar blocks Invoice Sync for the whole organization, so nobody else can approve it, as Attacks through apps and integrations recommends for apps like it. It also stops automatic forwarding to outside addresses for the finance team.
Giving the account back
Returning the account starts with knowing that the person receiving it is Riley, and the attacker may control Riley's mailbox, recovery address or phone. So Quinn meets Riley in person and checks Riley against the record Cedar's directory already held. For someone working remotely, the same check needs an established identity process and contact details the attacker could not have changed, as Attacks on recovery and the help desk explains, because a video call or a phone call alone proves little.
While sign-in is still blocked, Cedar sets the account's password to a long random value that nobody is told, so that nothing the attacker knew still works. Once Riley is verified, Quinn issues a one-time enrollment link, valid for an hour and opened by Riley in front of Quinn, rather than handing over a temporary password. Riley uses it to enroll a passkey, which a relay like this one cannot use, and then sets a new password. Nobody else ever knows a credential to Riley's account.
The account comes back carefully. For the first few days, Cedar asks Riley to confirm sensitive changes, such as adding a method or approving an app, with the new passkey, and the security team watches the account closely. Quinn also explains to Riley what happened and why, without blame. The page was convincing, and the fixes that matter most are to the system, not to Riley.
Try putting Cedar's cleanup in order.
Put the steps in order
Simulation. This fictional cleanup assumes Cedar has confirmed that enrolled methods, Invoice Sync's grant and mail forwarding remain after its password-only reset. Block sign-ins, remove unauthorized access and verify the owner before restoring access. Answers stay in your browser.
Repairing what changed
Cutting off access does not undo what the attacker did while inside. Some changes can be reversed: the mail rule is gone, and the authenticator with it. Others cannot. Messages already forwarded to the outside address stay there, and the 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 that Invoice Sync read from the payments vendor's email at 11:30 on Day 1 has been seen.
Quinn works through what the timeline shows. The rule forwarded every message mentioning an invoice for a full day, so Cedar lists those messages and works out whose information they contained: vendors, customers, bank details. If anything was sent in Riley's name, its recipients hear from Cedar directly, because a request to change payment details from a genuine Cedar mailbox is very convincing. The vendor key is replaced and its use checked; Rotating credentials and keys after exposure follows that work in detail. Depending on the information involved and where Cedar operates, some of this may also have to be reported to the people affected or to regulators, a decision for Cedar's legal and privacy staff.
Configuration needs the same care. The administrator's account should be untouched, because the help desk refused the caller's 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. reset, but Quinn confirms that from the records rather than assuming it.
Watching for a return
An attacker who loses access often tries again. They know Riley's role, which vendors Cedar pays and what Cedar's invoices look like, and they may hold something the cleanup missed. For the following weeks, Cedar watches for the specific traces of this incident:
- sign-in attempts to Riley's account, or any account, from 203.0.113.0/24;
- attempts to approve Invoice Sync, now blocked, or other apps asking for access to mail;
- new mail rules forwarding outside Cedar;
- requests to reset sign-in methods for Cedar's administrators;
- requests made with the old vendor key.
Specific traces like these are indicators, often called indicators of compromise: values that tie activity to one incident. They lose their value quickly, because attackers change networks, app names and stories, so Cedar also strengthens the general rule that caught this incident. A rejected sign-in with Riley's old password from the attacker's network is useful news: the cleanup held, and the attacker is still interested.
Learning from the incident
Once the account is back and the watch is in place, Cedar holds a post-incident review. Quinn, Rowan and the teams that run sign-in, mail and payments walk through the timeline together. The review is blameless: it asks how the attack worked and why each defense let it through, not who made a mistake. Riley did what many careful people do with a convincing page, and a defense that depends on nobody ever being fooled will fail again. People who expect blame also stop reporting the next suspicious email.
The review's output is a list of findings, each one a specific change with an owner and a date. The review meets again later to check which of those changes actually happened. Findings about the attack itself ask which defense would have stopped the relay or the app approval; Layered defenses and secure defaults maps every step of the incident to the layer that would have stopped it.
Two of Cedar's findings came from the response rather than the attack. The mail service had recorded the forwarding rule without a session ID, so Quinn could tie it to the attacker only by network and timing. The mail team takes that finding, and from then on records the session behind every mailbox change. The second finding concerns the alert. It fired almost a day after the authenticator was added, and the attacker spent that day reading mail. Why the rule took so long, and how to make it fire within minutes, goes to the security team as a finding of its own. The review also records what worked, such as records detailed enough to rebuild the morning, so that those are kept and tested rather than taken for granted.
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
- Lock an account, remove every way back, and hand it back in orderLock a temporary account that was given an extra authenticator, remove every sign-in method, replace the password while locked, then unlock and watch.