How do we…
How do we recover when the attacker may control our sign-in directory?
Add to board memoOpen the memo
The short answer
- Recommendation
- Assume the attacker had administrator rights in the directory unless the investigation shows they did not. Rebuild or recover and clean the directory first, in an isolated recovery environment with new administrator accounts, and connect nothing that trusts the old directory until it has been rebuilt in its turn.
- Reasoning
- Administrator rights in the sign-in directory open every other system, so most destructive attacks reach it. Whoever controls the directory controls every system that trusts it: a system rebuilt cleanly and then joined to a compromised directory is compromised again at once. Stolen credentials also survive a rebuild. Resetting in order closes the attacker's widest access first, and resetting the directory's signing keys twice stops sign-in tokens the attacker forged.
- Considerations
- There are two routes: build a new directory and create accounts again from a reviewed list, or recover a checked copy from before the earliest sign of the attacker and clean it. Both end with the same review.
- Use sealed emergency accounts only to start the recovery environment or take back a cloud identity tenant. If the attacker could have reached their credentials, treat them as compromised and create new ones.
- A cloud identity tenant can hold the same foothold. Check its administrators, trusted devices and external trusts the same way.
- If a managed IT provider runs the directory, agree in advance that it rebuilds with new accounts from clean devices.
The decision, step by step
Select any step for the reasoning behind it and where the pack covers it.
- Start
- Step
- Decision
- Outcome
- Loop back
Keyboard: Tab to a step, arrow keys move along the flow, Enter pins its explanation, + and − zoom, 0 fits the diagram, Esc closes. The text version below has the same content.
Where a step quotes a number, it is the default in the CISO Times pack. Your own standard may set a different one.
Read as text
The same flow written out: each step, its reasoning and where the pack covers it. 18 steps.
Start
The attacker may have controlled the sign-in directory
Most destructive attacks reach the sign-in directory, because administrator rights there open every other system. Whoever controls the directory controls every system that trusts it: a system rebuilt cleanly and then joined to a compromised directory is compromised again at once. The directory is one of the foundations, and it comes back first.
In the pack
- P22-A03 Cyber Recovery Operating ProcedureWhen the attacker may control the sign-in directory
- P22-A06 Clean-Room Recovery & Rebuild ChecklistGates Explained (rule CG-08)
- P22-A03 Cyber Recovery Operating ProcedureFoundations first (rule RR-08)
Decision
Can you administer without the accounts the attacker may hold?
If the attacker holds the normal administrator accounts, or the directory they sign in through, the recovery team needs a way in that does not depend on them. Answer yes only if you have a route the attacker could not have reached. If you are not sure, answer no.
- No, or not sure: Use sealed emergency accounts only to get started
- Yes: Stand up the recovery environment with new admin accounts
In the pack
- P22-A03 Cyber Recovery Operating ProcedureEmergency administrator accounts (rule P14 PA-12)
Step
Use sealed emergency accounts only to get started
Use the break-glass accounts only to start the recovery environment or take back a cloud identity tenant, and no more. Declare and record every use for review. If the attacker could have reached their credentials, treat them as compromised and create new ones. After each use, the session is reviewed and the credential changed and resealed, each within 1 working day by the pack's default.
In the pack
- P14-A02 Privileged Access StandardEmergency access (rule PA-12)
- P14-A02 Privileged Access StandardAfter emergency use
- P22-A03 Cyber Recovery Operating ProcedureEmergency administrator accounts
- P22-A06 Clean-Room Recovery & Rebuild ChecklistGates Explained (rule CG-04)
Step
Stand up the recovery environment with new admin accounts
Build an isolated network with no path to production. Create new administrator accounts there, each held by a named person, with no trust to the production directory: a trust lets any account the attacker holds walk straight in. Work from devices newly built or never connected to the affected network, and run monitoring to a console the attacker could not reach.
In the pack
- P22-A03 Cyber Recovery Operating ProcedureStage R2: Isolate and prepare (rule CG-01 to CG-05)
- P22-A02 Business Continuity & ICT Resilience PolicyRecovery and return to service (rule RR-13)
Decision
Has the investigation shown the attacker had no admin rights there?
Answer yes only when the incident investigation has shown the attacker never held administrator rights in the directory. If it shows they did, or it is not yet known, the directory is rebuilt or recovered and cleaned first. The incident plan's rule is the same: where the attacker had administrator rights, rebuild the systems it controlled, starting with the sign-in directory.
- Yes, shown: Recover it first with the foundations, as restore or rebuild decides
- No, or not known: Is there a checked directory copy from before the earliest sign?
In the pack
- P22-A03 Cyber Recovery Operating ProcedureStage R1: Assess (rule CG-08)
- P09-A06 Ransomware Response PlaybookDecision tree (rule D4)
Step
Recover it first with the foundations, as restore or rebuild decides
The directory still comes back first among the foundations, restored or rebuilt as the incident manager decides for it. The extra cleaning gate does not apply, but credentials are still reset in the incident plan's order before anything depends on them.
In the pack
- P22-A03 Cyber Recovery Operating ProcedureFoundations first (rule RR-08)
- P22-A03 Cyber Recovery Operating ProcedureThe trust question: restore or rebuild (rule P09 D4)
Decision
Is there a checked directory copy from before the earliest sign?
The pack allows two routes: build a new directory, or recover one from a copy taken before the earliest sign of the attacker and clean it. A copy is usable only if it predates the earliest sign and passed its integrity check and a scan. If none does, or you cannot tell, build new.
- Yes, checked and scanned: Recover that copy in the recovery environment
- No, or not known: Build a new directory and create accounts from a reviewed list
In the pack
- P22-A03 Cyber Recovery Operating ProcedureWhen the attacker may control the sign-in directory (rule RR-12)
Step
Recover that copy in the recovery environment
Restore the directory from the chosen copy inside the isolated environment, never onto the production network. The copy predates the earliest sign, but something placed before anyone noticed can still be in it, so it is cleaned before anything trusts it.
In the pack
- P22-A03 Cyber Recovery Operating ProcedureWhen the attacker may control the sign-in directory
- P22-A06 Clean-Room Recovery & Rebuild ChecklistGates Explained (rule CG-14)
Step
Build a new directory and create accounts from a reviewed list
Install the directory from a trusted build source, an offline image with a matching hash or fresh vendor media, and configure it from a stored, reviewed baseline. Create accounts and groups again from a list someone has reviewed, not by copying them from the affected directory.
In the pack
- P22-A03 Cyber Recovery Operating ProcedureWhen the attacker may control the sign-in directory
- P22-A06 Clean-Room Recovery & Rebuild ChecklistGates Explained (rules CG-06, CG-07)
Step
Remove every unknown account, group, policy and trust
Both routes end with the same review. Remove accounts, groups, policies and trusts nobody can account for, and anything the attacker left behind. Record the review: it is the evidence that the directory was cleaned before any system depends on it.
In the pack
- P22-A06 Clean-Room Recovery & Rebuild ChecklistGates Explained (rule CG-08)
- P09-A06 Ransomware Response PlaybookEradicate (rule E2)
Step
Reset credentials in order, and the signing keys twice
Stolen credentials survive a rebuild. Reset from clean devices, in the incident plan's order: administrator accounts, service accounts, remote access, the backup system, then users, and end all signed-in sessions. Where the directory was compromised, reset its own signing keys twice, so sign-in tokens the attacker forged stop working.
In the pack
- P22-A06 Clean-Room Recovery & Rebuild ChecklistGates Explained (rule CG-09; P09 E3)
- P09-A06 Ransomware Response PlaybookEradicate (rule E3)
Step
Check the cloud tenant's admins, trusted devices and trusts
A cloud identity tenant can hold the same foothold as the on-premises directory. Check its administrators, trusted devices and external trusts the same way, and remove anything nobody can account for.
In the pack
- P22-A03 Cyber Recovery Operating ProcedureWhen the attacker may control the sign-in directory
Step
Rebuild the rest of the foundations, then systems in order
After the directory, rebuild the core network and firewalls, the backup platform, and endpoint protection and monitoring, then each system in the recovery order. Patch each before it holds data and close the attacker's way in on every one. Services that depend on the foundations cannot come back sooner than the time it takes to rebuild them.
In the pack
- P22-A03 Cyber Recovery Operating ProcedureFoundations first (rule RR-08)
- P22-A03 Cyber Recovery Operating ProcedureStage R3: Rebuild clean (rules CG-10, CG-11)
Decision
Does anything about to connect still trust the old directory?
Servers, applications, interfaces and devices joined to the old directory will accept whatever it issues, including what the attacker created. Connect nothing that trusts the old directory until it has been rebuilt in its turn. If you are not sure, answer yes.
- Yes, or not known: Keep it apart until it is rebuilt or rejoined in its turn
- No: Does the sweep find this attack's indicators or persistence?
In the pack
- P22-A03 Cyber Recovery Operating ProcedureWhen the attacker may control the sign-in directory
Step
Keep it apart until it is rebuilt or rejoined in its turn
Leave it disconnected, rebuild it in the recovery order, and join it to the rebuilt directory. Interfaces to suppliers and customers are set up again with new credentials or keys, and the other side confirms. Then ask the question again.
- Then: Does anything about to connect still trust the old directory? (back to an earlier step)
In the pack
- P22-A06 Clean-Room Recovery & Rebuild ChecklistGates Explained (rule CG-18)
Decision
Does the sweep find this attack's indicators or persistence?
Before anything is trusted with users, sweep the directory and each system for this attack's indicators and for ways back in: new accounts, scheduled tasks, remote access tools. Run it before you answer: nothing reconnects on a sweep that has not run.
- Yes, or not sure: Stop reconnecting and hand back to the incident manager
- No, it is clean: Return systems in stages through the gates
In the pack
- P22-A06 Clean-Room Recovery & Rebuild ChecklistGates Explained (rule CG-16)
Outcome
Stop reconnecting and hand back to the incident manager
An indicator on a rebuilt system means the attacker may still be in. Stop reconnecting; the system goes back under incident response, and its stage restarts only when eradication is confirmed again.
In the pack
- P22-A03 Cyber Recovery Operating ProcedureWhen to escalate (rule P09 E5; CG-16)
Outcome
Return systems in stages through the gates
Each system returns only when the clean-room gates and the incident plan's recovery criteria are met and its business owner has tested the service. Reconnect one service or site at a time under closer monitoring, and keep watching through the monitoring period.
In the pack
- P22-A02 Business Continuity & ICT Resilience PolicyRecovery and return to service (rule RR-18)
- P22-A03 Cyber Recovery Operating ProcedureA staged return (rule CG-21; P09 V5)
Practical checklist
- Stand up an isolated recovery environment with new administrator accounts held by named people, no trust to the production directory, and clean devices.
- Rebuild the directory new from trusted build sources and a reviewed baseline, or recover a checked, scanned copy from before the earliest sign.
- Remove every account, group, policy and trust nobody can account for, and record the review.
- Reset credentials from clean devices in the incident plan's order: administrators, service accounts, remote access, the backup system, then users.
- Reset the directory's signing keys twice and end all signed-in sessions.
- Check the cloud identity tenant's administrators, trusted devices and external trusts.
- Rebuild the rest of the foundations, then systems in the recovery order, keeping anything that trusts the old directory disconnected.
- Sweep for this attack's indicators and persistence before each system reconnects in stages.
Evidence to have ready
- The investigation's finding on whether the attacker held administrator rights in the directory.
- Every use of an emergency administrator account, its review and the credential change that followed.
- The route taken for the directory, with the build source hashes or the chosen copy's date and checks.
- The review of accounts, groups, policies and trusts, and what was removed.
- The record of credential and signing key resets, in order, with dates.
- The sweep results and the gate checks for each system before it reconnected.
Assumptions
- Your incident response has contained the attack, and its investigation can say whether the attacker had administrator rights in the directory.
- You have emergency administrator accounts sealed and tested under your privileged access standard, or another way in that does not depend on the directory.
- Where a managed IT provider runs your directory, its contract lets you require a rebuild with new accounts from clean devices.
Not covered here
- When to use a break-glass account in normal operation, and what follows each use. That is “When do we use a break-glass account, and what must happen afterwards?”.
- Choosing the backup copy the directory or any system is restored from. That is “How do we choose which backup to restore from after a cyberattack?”.
- Deciding restore or rebuild for the other systems. That is “If ransomware has encrypted production, do we restore or rebuild?”.
Related questions
- When do we use a break-glass account, and what must happen afterwards?
- If ransomware has encrypted production, do we restore or rebuild?
- If a service was compromised, what evidence is enough to reconnect it?
- How do we choose which backup to restore from after a cyberattack?
- How do we plan recovery from a destructive cyberattack, and how is it different from disaster recovery?