Join our Newsletter — 33% off our NHI Course
Home› Guides› Declaring Systems Clean: Validation Criteria Before Reconnecting After…
Guide Incident Response & Forensics

Declaring Systems Clean: Validation Criteria Before Reconnecting After Compromise

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 12 min read
On this page

The most expensive moment in many incidents is not the first compromise but the second one, when a system declared clean goes back on the network and the attacker walks straight back in. Reinfection usually comes from something nobody re-validated: a service account password left unchanged, a scheduled task on a host that was "only remediated", a backup that already held the implant, or a Kerberos key that still signs forged tickets. This guide sets out validation criteria an incident lead can apply before reconnecting systems after a compromise: when to rebuild instead of remediate, what evidence each criterion needs, how to reset human and non-human credentials in the right order, and how to reconnect in stages with a monitoring window. It is for incident response leads, infrastructure managers and the people who sign off recovery. No set of checks proves a system is clean; the aim is a documented, defensible decision that the residual risk is acceptable.

Key takeaways

  • "Clean" is a risk decision, not a fact. Declare a system fit to reconnect against written criteria, with named sign-off and a monitoring window, never on the absence of alerts alone.
  • Rebuild by default for anything privileged. Domain controllers, identity servers, hypervisors and management tools that the attacker touched should be rebuilt from trusted media, not cleaned in place.
  • Credentials outlive malware. Every password, key, token and certificate the attacker could have read must be rotated, including service accounts and API keys, and the krbtgt password reset twice where Active Directory was in scope.
  • Order matters. Rotate after the attacker is evicted and the identity source is trusted again; rotating earlier hands the new secrets to the same intruder.
  • Reconnect in stages. Bring systems back in rings behind tightened network rules, with enhanced monitoring for a defined period, and a rollback trigger agreed in advance.

Why clean declarations fail

The NCSC's recovery guidance for disruptive attacks is blunt: if you are not sure the attacker has gone, proceeding with recovery carries a risk of the incident restarting. It advises assuming the attacker may have reached more than you have confirmed, treating backups as possibly targeted, and not assuming that backups or identity systems are trustworthy until assured. The common failure routes are:

  • Scope too narrow: only the hosts with alerts are cleaned, while the attacker holds valid accounts (ATT&CK T1078 Valid Accounts) that work from anywhere.
  • Persistence missed: web shells (T1505.003), scheduled tasks (T1053) or added credentials on accounts and applications (T1098 Account Manipulation) survive an antivirus clean.
  • Credentials left unrotated: in the Cloudflare Thanksgiving breach, one service token and three service account credentials exposed in an earlier supplier breach were not rotated because they were believed to be unused, and an attacker used them. Cloudflare's remediation then rotated more than 5,000 production credentials and reimaged every machine in its global network. See the Incomplete rotation breaches page.
  • Forged authentication survives: an attacker with the krbtgt hash can mint Kerberos tickets (T1558.001 Golden Ticket) until that key is changed twice.
  • Infected backups: restores reintroduce the implant because nobody checked the restore point. See the Last Clean Restore Point Guide.
  • Pressure to restore: the business needs systems back, so the criteria are relaxed quietly instead of formally accepting the risk.

Rebuild vs remediate

Remediation in place (removing artefacts and patching) is faster but relies on knowing every change the attacker made. Rebuilding from trusted media removes unknown persistence on that host but does nothing about stolen credentials or other hosts. CISA's ransomware response checklist advises rebuilding systems in order of critical services, using pre-configured standard images where possible, and taking care not to reinfect clean systems during recovery.

System typeDefault approachWhen the alternative is acceptable
Domain controllers, identity providers, PKI serversRebuild, or forest recovery from a validated backupRarely; only with high confidence the system was never reached and logs cover the whole dwell time
Hypervisors, backup servers, management and deployment toolsRebuild from vendor media and reapply hardened configurationNever where the attacker held administrative access to them
Servers with confirmed implant or attacker toolingRebuild from a golden image and redeploy the application from source controlRemediate only where forensic analysis has a complete timeline and the host is low privilege
WorkstationsReimageRemediate where only commodity malware was found with no hands-on activity
Cloud workloads and containersRedeploy from pipeline with new images and new identitiesRarely sensible to clean a running instance
SaaS tenantsCannot rebuild: review configuration, apps, consents and admin roles against a baselineNot applicable

Decision guidance: a small organisation with one site may find a full rebuild of everything faster than an investigation. A large estate usually rebuilds tier 0 and confirmed hosts, remediates the rest on evidence, and accepts a longer monitoring window. Where the dwell time is unknown or logs do not cover it, lean to rebuild. For recovery in a separate environment, see the Cloud Recovery and Clean Room Guide; for the differences between stages see Containment vs Eradication.

Validation criteria

Apply the criteria per system or per system group. Each one needs evidence that a reviewer other than the person doing the work can check.

CriterionWhat must be trueEvidence to keep
Scope confirmedInvestigation has identified initial access, accounts used and systems reached, and the investigation lead advises the risk is low enough to proceedTimeline, list of affected identities and hosts, investigation lead's written advice
Trusted build sourceRebuilt systems come from a golden image or vendor media verified by hash, held offline or in a protected repositoryImage ID, hash, build record
Restore point validatedBackup predates the earliest attacker activity and has been scanned and tested in isolationRestore point date, scan results, test restore record
IOC sweep cleanAll known indicators (hashes, domains, IPs, file paths, registry keys, scheduled tasks, services) swept across the whole estate, not only the rebuilt hostSweep query, coverage percentage, results
Persistence reviewAutoruns, services, scheduled tasks, web roots, startup scripts, Group Policy objects, cloud functions and OAuth apps compared with a baselineDiff against baseline, reviewer sign-off
Initial access closedThe vulnerability, misconfiguration or exposed credential used to get in is fixed and verifiedPatch record or configuration change, rescan
Credentials rotatedEvery credential in scope rotated in the order set out below, including non-human identitiesRotation register with times and owners
Hardening appliedBuild meets the current baseline, with local admin, remote access and logging settings as requiredConfiguration scan result
Logging and detection liveEndpoint detection agent installed and reporting, logs forwarded, new detections for this attacker's behaviour deployedAgent health report, sample events in the SIEM
Rollback readyIsolation procedure tested for each ring before reconnectionTest record

An IOC sweep only finds what is already known. Add a time-boxed hunt for the attacker's techniques rather than artefacts; see the Compromise Assessment Guide and the Identity Threat Hunting Guide. For rebuild baselines see the Server Build and Golden Image Hardening Guide.

Identity and credential reset before reconnection

The NCSC advises re-establishing a trusted identity source first, because everything else depends on it, and resetting credentials where required, including privileged accounts. Rotation is wasted if the attacker still has a foothold, so sequence it after eviction and before reconnection.

  1. Secure the identity tier. Rebuild or recover domain controllers and the identity provider, remove attacker-created accounts, federation trusts, application credentials and role assignments.
  2. Reset krbtgt twice. Microsoft's forest recovery guidance says to reset the krbtgt password twice and wait 10 hours between resets, because 10 hours is the default maximum user and service ticket lifetime; if those policies are longer, wait longer than the configured value. The account keeps a password history of two, so the second reset clears the old key. The procedure applies to writable domain controllers; read-only domain controllers have their own krbtgt_<number> accounts. See the krbtgt account guide.
  3. Privileged human accounts. Reset administrator passwords, remove and re-register MFA methods, and revoke sessions. In Microsoft Entra ID, Revoke-MgUserSignInSession revokes refresh tokens, but issued access tokens remain valid until expiry (one hour by default), and application session cookies must be revoked by each application. Microsoft notes that resetting an on-premises password twice mitigates pass-the-hash risk where replication is delayed.
  4. Non-human identities. Rotate service account passwords, API keys, cloud access keys, OAuth client secrets, SSH keys, signing keys and certificates that were stored on or reachable from affected systems. Check vaults, CI/CD variables, configuration files and scripts. Unknown owners are not a reason to skip a credential: an unused credential should be disabled.
  5. Standard users. Force password changes and session revocation for affected populations, at minimum.
  6. Third parties. Rotate credentials shared with suppliers and ask them to rotate theirs where they connect to you.

Expect breakage: rotated service account passwords stop applications that hard-code them. Plan rotation windows with application owners and use the Credential Rotation at Scale and Workload Identity Compromise Response Playbook pages. For the human side, see the Identity Incident Response Playbook.

Staged reconnection and monitoring

The NCSC advises balancing the pace of restoration against the assurance needed, bringing core functions back in a controlled manner, and notes that third parties may require evidence of remediation before restoring connectivity. A practical sequence:

  1. Ring 0, isolated validation: rebuilt identity and management systems run in a segregated network with only the connections they need. Confirm logging and detection work.
  2. Ring 1, critical services: reconnect the systems behind the organisation's minimum viable operations, with egress restricted to known destinations and new detections live. See the Minimum Viable Company and Critical Service Recovery Order Guide.
  3. Ring 2, wider internal estate: reconnect remaining servers and workstations in batches, each checked against the criteria table.
  4. Ring 3, external connectivity: restore partner, supplier and remote access links last, with fresh credentials and any evidence partners require.

Monitoring window: set an enhanced monitoring period before closing the incident, sized to the attacker's observed dwell time and the length of any tokens or tickets that might still be valid (our recommendation is at least 30 days for hands-on intrusions). Watch for sign-ins with rotated or disabled accounts, beaconing to known infrastructure, new persistence on rebuilt hosts and use of old API keys. Agree the rollback trigger in advance: any confirmed indicator on a reconnected host returns that ring to isolation.

MetricTarget
Systems reconnected with all criteria evidenced100% (exceptions risk-accepted in writing)
In-scope credentials rotated or disabled, human and non-human100% before ring 1
Endpoint and log coverage on reconnected systems100% reporting within 24 hours of reconnection
Failed authentications using rotated or disabled credentialsEvery event investigated; a rising trend triggers review
Reinfection events during the monitoring windowZero; any event reopens the incident

Sign-off and evidence

CISA's checklist says the designated IT or security authority declares the incident over based on established criteria, and NIST CSF 2.0 outcome RC.RP-06 calls for the end of recovery to be declared based on criteria with documentation completed. Write the criteria before the incident and record decisions against them.

RoleSigns off
Investigation leadScope, eviction confidence and residual unknowns
System ownerRebuild or remediation complete, functional testing passed
Identity ownerIdentity tier trusted, credential rotation register complete
Security operations leadDetection and logging live, monitoring window plan
Incident leadEach reconnection ring, against the criteria
Senior risk ownerAny criterion not met, accepted in writing with an expiry date

Keep the evidence pack with the incident record: criteria table per system group, rotation register, sweep and hunt results, reconnection log and the risk acceptances. Wording matters: record "no evidence of continued attacker activity based on the checks listed" rather than "system is clean". Feed findings into the Post-Incident Review and Root Cause Analysis Template.

ActivityNIST CSF 2.0NIST SP 800-53 Rev. 5CIS Controls v8.1
Eradication and persistence removalRS.MI-02IR-4Control 17
Restore point and image validationRC.RP-03CP-10, SI-7Control 11
Credential rotationRS.MI-02IA-5Control 5
Verify restored assets and confirm statusRC.RP-05CP-10Control 11
Monitoring windowDE.CM-01SI-4Control 13
Declare end of recoveryRC.RP-06IR-4Control 17

Practitioner checklist

  • Write reconnection criteria and sign-off roles into the incident response plan before an incident.
  • Get the investigation lead's written advice on eviction confidence before any reconnection.
  • Rebuild identity, management, backup and virtualisation systems the attacker reached; do not clean them in place.
  • Validate golden images and restore points by hash, date and isolated scan before use.
  • Sweep the whole estate for indicators and run a technique-based hunt, not only the rebuilt hosts.
  • Reset krbtgt twice with the ticket lifetime wait between resets where Active Directory was in scope.
  • Rotate or disable every in-scope credential, including service accounts, API keys, OAuth secrets and certificates, and keep a register.
  • Reconnect in rings with restricted egress, new detections and a tested rollback.
  • Hold an enhanced monitoring window and reopen the incident on any reinfection signal.
  • Record decisions as risk statements with evidence, never as a guarantee that systems are clean.

Standards and references

Related NHI Mgmt Group resources: Active Directory Forest Recovery Runbook Template · Identity Recovery Guide · Secret Rotation vs Revocation · MITRE D3FEND Credential Eviction Implementation Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.