After a ransomware attack, every system on the recovery list needs one decision before anyone touches a backup: restore it, or rebuild it from known good components. Restoring is faster but can bring back the attacker's persistence; rebuilding is cleaner but slower and needs images, code and configuration you may not have. This guide gives incident response leads and infrastructure teams a way to make that call system by system: the decision factors, a per-system table for identity, hypervisors, servers, endpoints and SaaS, how to validate a backup before trusting it, and the order to bring things back. It does not repeat the overall response process (containment, scoping, notification, the ransom decision), which is in the Ransomware Response and Recovery Guide. These are judgement calls under pressure; treat the guidance here as defaults to adapt, not fixed rules.
Key takeaways
- Separate data from the system that holds it. In most cases the safest pattern is to rebuild the operating system and application from trusted sources and restore only the data, rather than restoring a whole server image.
- Identity comes first. Nothing restored onto a domain the attacker still controls can be trusted, so the identity tier is recovered and its secrets rotated before other tiers are reconnected.
- The compromise date decides which backups are usable. A backup taken after initial access may contain the attacker's persistence; CISA notes that a ransomware event may indicate an earlier, unresolved compromise.
- Validate before you trust. Restore into an isolated environment, scan, check for known indicators and persistence, and confirm integrity before anything rejoins production.
- Decide per system, and record why. A written decision per asset, with the evidence behind it, keeps the team consistent and gives auditors and insurers a clear trail.
Restore vs rebuild: the core question
The question is not "do we have a backup?" but "can we prove this restore point is free of the attacker?". Restoring returns a system to a past state, including anything the attacker had already placed there. Rebuilding creates a new system from sources you control, then reapplies configuration and data. In practice there are four paths, and most recoveries use all of them for different assets.
| Path | What it means | Best when | Main risk |
|---|---|---|---|
| Full restore | Restore the whole system image or VM from backup | Restore point clearly predates initial access; system is hard to rebuild | Reintroducing persistence planted before the restore point |
| Rebuild and restore data | Fresh OS and application from golden image or code, then restore data only | Compromise date uncertain; data is valuable and cannot be recreated | Malicious content in the data itself (macros, web shells in content directories, poisoned config) |
| Full rebuild | New system from images, infrastructure as code or vendor media; no restore | Stateless or easily reconfigured systems; attacker had administrative control | Slower; depends on build documentation and images being current and untouched |
| Recover in place | Clean the running system without restore or rebuild | Rarely appropriate after human-operated ransomware; possibly for low-value endpoints with strong EDR evidence | Missed persistence; hardest to prove clean |
CISA's #StopRansomware Guide points the same way: rebuild systems in order of critical services "using pre-configured standard images, if possible", use infrastructure as code templates for cloud resources, and restore data from offline, encrypted backups. It also warns to identify precursor dropper malware before rebuilding from backups, to avoid continuing the compromise.
Decision factors
Score each system against these factors. When several point to rebuild, rebuild.
- Attacker privilege on the system: if the attacker held administrative or SYSTEM level access, or the system is in the identity tier, assume anything on it could be altered. Lean towards rebuild.
- Confidence in the compromise timeline: if forensics give a reliable earliest compromise date and you hold backups from before it, restore becomes viable. If the date is unknown or the intrusion was long, the usable backup window shrinks or disappears. CISA notes that a ransomware event may indicate "a previous, unresolved network compromise".
- Persistence found so far: CISA calls for "extended analysis to identify outside-in and inside-out persistence mechanisms". Scheduled tasks, services, autostart entries and server components such as web shells (ATT&CK T1053, T1547, T1505) survive a restore if they predate it.
- Rebuildability: do you have a current golden image, infrastructure as code, configuration management or documented build? If not, rebuild time may be unacceptable and a validated restore becomes the pragmatic choice. See the Server Build and Golden Image Hardening Guide.
- Data value and recency: how much data loss can the business accept, and can data be recreated from another source? Older, cleaner restore points cost more lost data.
- Business priority: systems on the critical service list may justify a faster validated restore with heavier monitoring, while lower tiers wait for a clean rebuild. See the Minimum Viable Company and Critical Service Recovery Order Guide.
- Evidence needs: preserve images of key systems for forensics and insurers before you rebuild or wipe them.
Small vs large organisations
A small organisation with a handful of servers and no build automation may rebuild by hand faster than it could validate a restore, and should keep a simple written decision per server. A large organisation should pre-classify assets by tier and default path before any incident, so that on the day the team confirms or overrides a decision rather than inventing it.
Per-system decision table (AD, hypervisors, servers, endpoints, SaaS)
These are default positions for a human-operated ransomware incident where the attacker gained domain administrative access. Adjust them with evidence.
| System | Default path | Why | Conditions to deviate |
|---|---|---|---|
| Active Directory domain controllers | Restore one trusted DC per domain in isolation, rebuild the rest; rotate secrets | Microsoft's forest recovery process restores from a trusted backup, then redeploys the remaining DCs | If no trusted backup exists, a new forest may be needed; take specialist advice |
| Entra ID and cloud identity | Recover in place: review and revert configuration, remove rogue objects, reset credentials | The tenant cannot be restored as an image | Use configuration backups where held |
| Hypervisor hosts (for example ESXi) | Rebuild hosts from vendor media and standard configuration | Host configuration is small and reproducible; a compromised host undermines every guest | None in most cases |
| Virtualisation management (for example vCenter) | Rebuild, or restore only after validation in isolation | Holds credentials and control over all guests | Validated restore when rebuild time is unacceptable and the restore point predates compromise |
| Backup servers and consoles | Rebuild from clean media; reconnect to protected storage | Attackers target backups to inhibit recovery (ATT&CK T1490) | Restore the catalogue only after validation |
| Application and file servers | Rebuild OS and application, restore data | Separates trusted code from valuable data | Full restore if the restore point clearly predates initial access |
| Database servers | Rebuild server, restore database from validated backup, check integrity | Data is critical and cannot be recreated | Point-in-time restore must sit before any malicious change |
| Web servers | Rebuild from code and deployment pipeline | Web shells often hide in content directories | Restore static content only after review |
| Endpoints | Reimage from standard build; user data from cloud sync or backup | Cheap to rebuild at scale | Clean in place only with strong EDR evidence and low privilege exposure |
| Cloud workloads | Redeploy from infrastructure as code into clean accounts or subscriptions | CISA recommends infrastructure as code templates | Restore data stores from protected snapshots |
| SaaS applications | Recover in place: restore items from versioning or third-party backup; review admin roles, apps and tokens | No system image exists; persistence lives in accounts, integrations and OAuth grants | Not applicable |
Identity tier first
Microsoft's AD forest recovery guidance prefers shutting down all writeable DCs before the first restored DC returns, so that "dangerous data doesn't replicate back into the recovered forest", and restoring onto an isolated network. It advises a backup that holds "the last safe state of the forest", noting that a more recent backup "might increase the risk of reintroducing dangerous data". During initial recovery it says to reset the krbtgt password twice, because its password history holds two passwords, and adds that trust passwords may also be reset when recovery follows a security breach. Where the database was compromised it recommends a new KDS root key and recreating group managed service accounts. Detailed steps are in the Identity Recovery Guide, the Active Directory Forest Recovery Runbook Template and the krbtgt account guide.
Where identity fits beyond AD
Every restored or rebuilt system brings back credentials: service account passwords, API keys, certificates and tokens in configuration files. Treat every secret that existed in the compromised environment as exposed. Rotate service accounts, managed identity secrets, backup system credentials and integration tokens as each tier comes back, and prefer group managed service accounts where possible. See the Group Managed Service Accounts (gMSA) Guide and the Backup Identity Isolation Guide.
Validating backups are clean
NCSC advises that backups should only be connected to known clean devices before recovery, and that backups should be scanned for malware before restoring because ransomware can be replicated to backups before it is discovered. CISA's guide adds the need to find precursor droppers first. NIST SP 1800-11, Data Integrity: Recovering from Ransomware and Other Destructive Events, describes how to detect corruption in standard enterprise components and support recovery after such events.
- Fix the earliest compromise date: work with the investigation team to set it, and record the confidence level.
- Select candidate restore points: the newest point before that date, plus one or two older points as fallbacks.
- Restore into an isolated recovery environment: a clean room with no route to production and its own clean administrative identities. See the Cloud Recovery and Clean Room Guide and the Cyber Recovery Vault Guide.
- Scan with updated tools: current antimalware signatures and the incident's own indicators of compromise (hashes, file names, domains).
- Hunt for persistence: scheduled tasks, services, autostart locations, unexpected accounts and group memberships, web shells and modified binaries, compared against the golden image or a known good baseline.
- Check data integrity: application-level consistency checks, record counts and spot checks by data owners.
- Record the result: restore point used, checks run, findings and the approver.
If every candidate fails, move that system to rebuild and restore only data that has itself been checked.
Sequencing recovery
CISA recommends restoring against a predefined critical asset list, taking care not to "re-infect clean systems during recovery", and resetting passwords for affected systems once the environment is "fully cleaned and rebuilt". A typical order is:
- Clean administrative foundation: privileged access workstations and clean admin accounts inside the recovery environment. See the Privileged Access Workstations Guide.
- Identity: recovered DCs, DNS, rotated krbtgt and privileged credentials, reviewed cloud identity configuration.
- Infrastructure: rebuilt hypervisors and management, network services, rebuilt backup platform.
- Security tooling: EDR and logging on every system before it returns, so any surviving persistence is seen.
- Critical business services: in priority order, each validated before reconnection.
- Remaining servers and endpoints: in waves, with monitoring tuned for the incident's indicators.
Rollback is part of the plan: if a reconnected system shows indicators again, isolate it, move it to the rebuild path and check whether it reached anything already restored. Finish when the designated authority declares the incident over against agreed criteria, as CISA describes. For hypervisor-specific steps see the ESXi Ransomware Playbook.
Detection and measurement
- Decision coverage: share of in-scope systems with a recorded restore or rebuild decision and its evidence.
- Reinfection rate: systems that showed indicators after reconnection (target: zero).
- Validation pass rate: share of candidate restore points that passed clean checks.
- Time to recover critical services: against the recovery time objective agreed for each.
- Secret rotation coverage: share of known credentials rotated before their system returned.
- Rebuild readiness (before an incident): share of tier 0 and tier 1 systems with a tested golden image or infrastructure as code definition.
Common failure patterns
- Restoring the newest backup by default: the newest clean-looking backup is often after initial access, and the attacker returns through the same persistence.
- Restoring servers onto an untrusted domain: application servers come back before identity is recovered, so the attacker's domain admin rights still apply.
- Forgetting non-human credentials: service accounts, API keys and integration tokens are reused unchanged after rebuild.
- Rebuilding from stale or exposed images: golden images stored on the compromised network, or never updated, are treated as trusted without checking.
- Wiping before preserving evidence: rebuilding the patient zero system destroys what the investigation needed to set the compromise date.
- Reconnecting without monitoring: systems return to production before EDR and logging, so reinfection is noticed only when it spreads.
Framework mapping
| Activity | NIST CSF 2.0 | NIST SP 800-53 Rev. 5 |
|---|---|---|
| Choose, scope and prioritise recovery actions per system | RC.RP-02 | CP-10 System Recovery and Reconstitution |
| Verify backup integrity before restoration | RC.RP-03 | CP-9 System Backup |
| Verify restored assets and confirm normal operation | RC.RP-05 | CP-10 |
| Eradicate persistence before reconnection | RS.MI-02 | IR-4 Incident Handling |
| Declare the end of recovery against criteria | RC.RP-06 | IR-4 |
| Pre-plan and test restore and rebuild paths | PR.DS-11 | CP-2 Contingency Plan, CP-4 Contingency Plan Testing |
Practitioner checklist
- Pre-classify every critical asset with a default path (restore, rebuild and restore data, rebuild, recover in place) and record the reasons.
- Keep golden images, infrastructure as code and build documentation outside the production trust boundary, and test them.
- Agree with investigators how the earliest compromise date will be set and how confidence is recorded.
- Prepare an isolated recovery environment with its own clean administrative identities.
- Document AD forest recovery, including isolated restore of one DC per domain and resetting krbtgt twice.
- Maintain an inventory of service accounts, API keys and certificates so they can be rotated during recovery.
- Define validation checks for restored data: malware scan, incident indicators, persistence hunt and integrity checks.
- Require EDR and logging on every system before it rejoins production.
- Rehearse the per-system decisions in a recovery exercise at least once a year.
Standards and references
- CISA: #StopRansomware Guide
- NCSC: Mitigating malware and ransomware attacks
- NIST: SP 1800-11 Data Integrity: Recovering from Ransomware and Other Destructive Events
- Microsoft Learn: AD Forest Recovery, determine how to recover
- Microsoft Learn: AD Forest Recovery, perform initial recovery
- Microsoft Learn: Human-operated ransomware
- MITRE ATT&CK: Inhibit System Recovery (T1490)
- NIST: Cybersecurity Framework 2.0
Related NHI Mgmt Group resources: Ransomware Response and Recovery Guide · Identity Recovery Guide · Backup Security and Immutable Backup Guide · Business Continuity and Disaster Recovery Guide