Repository navigation
Backup Isolation and Restore Testing
Last reviewed: 2026-11-29 (standards and vendor documentation checked; the restic and rest-server behaviour below was observed in CI run 46244151474; S3 Object Lock and offline media were not exercised)
Prerequisites: Recovery index ยท Backup & restore recovery lab
Explain how to keep at least one backup copy out of an attacker's reach and how to prove, with recorded evidence, that a restore from it produces the data you expect.
Summarizes the copy rules (3-2-1), the isolation options (offline, append-only, object lock), what each one does and does not stop, and the checks a restore test should record. Commands are restic examples, because restic is the tool the lab runs; the principles apply to any backup product.
A backup design in which a compromised production host or backup client cannot delete the last good copy, plus a restore test whose result is a file-by-file verification, not "the job succeeded".
- Designing or reviewing backup architecture for ransomware resilience.
- Writing the restore-test procedure that satisfies CSF 2.0 PR.DS-11 ("Backups of data are created, protected, maintained, and tested") and RC.RP-03.
- Choosing a restore point during recovery.
| Rule | What it says | Status |
|---|---|---|
| 3-2-1 | "3 copies of important files", "2 different types of storage media (like a hard drive and the cloud)", "1 copy stored off-site, away from your location" | CISA, Back Up Government Data (undated page) |
| 3-2-1-1-0 | 3-2-1 plus one offline, air-gapped or immutable copy, and zero errors on a verified restore | Industry convention from backup vendors. Not found in any NIST or CISA publication reviewed for this section; do not cite it as a standard |
| Offline copy | "Backups should have a copy stored offline or otherwise in a manner that prevents access to them by the attacker or compromise by ransomware." | NIST IR 8374r1, PR.DS-11 row |
| Offline, encrypted, tested | "Maintain offline, encrypted backups of critical data, and regularly test the availability and integrity of backups in a disaster recovery scenario [CPG 2.R]." | CISA #StopRansomware Guide |
The CISA guide also warns that automated cloud backups "may not be sufficient", because encrypted local files can be synchronized over the cloud copy.
| Option | What it stops | What it does not stop |
|---|---|---|
| Offline or air-gapped media | Any network-borne deletion while disconnected. SP 800-209 IS-SS-R8: "Organizations should consider setting up an air gap around the cyber-attack recovery copies of sensitive data." | Damage during the sync window; media failure; a copy that was already infected when taken |
Append-only backup service (for example rest-server --append-only) |
A compromised backup client deleting or overwriting existing backups through the service's API | Anyone with shell or storage access on the backup host; garbage snapshots that mislead retention policies (see below) |
| Object lock / WORM storage (for example S3 Object Lock) | Deletion or overwrite of locked object versions until the retention date, within the mode's rules | Data that was already bad when written; misconfigured retention; cost of retained data |
SP 800-209 IS-SS-R10 says to "Consider the use of immutable storage, which could help further isolate and protect recovery data (e.g., retention locking, vault locking, immutability policies)", and defines immutability as "the ability to lock data after it has been created, thereby preventing it from alteration or deletion." The CISA guide adds a caution: "Use immutable storage with caution as it does not meet compliance criteria for certain regulations and misconfiguration can impose significant cost."
Read from repo/repo.go at rest-server v0.15.0 and confirmed in the lab's CI run:
- The README says: "The
--append-onlymode allows creation of new backups but prevents deletion and modification of existing backups." - With
--append-only,DELETEof the repositoryconfigand of any object other than lock files returns 403. Lock files can still be deleted, so backups and checks keep working. - Uploading to an object name that already exists returns 403 with or without
--append-only, so "overwrite refused" is not what distinguishes the mode. The real difference isDELETE: allowed without the flag, refused with it. - In the lab,
restic forgetandrestic forget --keep-last 1 --pruneagainst the append-only server exited 3 ("unable to remove snapshot/... from the repository", "failed to remove one or more snapshots"), and both snapshots were still listed afterwards. Against the server without the flag,forgetexited 0 and removed the snapshot. - Without
--no-auth(and without--proxy-auth-username), rest-server refuses to start if its.htpasswdcannot be loaded. The lab used--no-authon loopback only; production needs authentication,--private-reposand TLS.
restic's own documentation (060_forget.rst, "Security considerations in append-only mode") adds two rules:
-
forgetandprune"require full read, write and delete access to the repository", so run them only from "a separate and well-secured client", never from the client being backed up. - An attacker who can add snapshots can make legitimate ones fall outside
--keep-lastor--keep-weeklywindows. On append-only repositories, use--keep-within.
From the S3 Object Lock documentation; not exercised here:
- Object Lock uses a write-once-read-many (WORM) model and requires S3 Versioning.
- Compliance mode: no user, including the root user, can overwrite or delete a protected object version during retention.
-
Governance mode: users with
s3:BypassGovernanceRetentioncan override retention by sendingx-amz-bypass-governance-retention:true; the console sends that header by default, so governance mode is weaker than it looks. -
Legal hold: no expiry; it stays until someone with
s3:PutObjectLegalHoldremoves it. - A
DELETEthat names a locked version is refused with 403. ADELETEwithout a version ID succeeds and only adds a delete marker; the locked version remains.
A restore test has to show more than a successful exit code. The lab records each of the following:
| Check | Why | restic example |
|---|---|---|
| Name the restore point | The latest snapshot may already contain damaged data. In the lab, restoring latest after the event succeeded (exit 0) but returned 0 verified files and 11 damaged ones |
restic snapshots then restic restore <snapshot-id> --target <new-dir>
|
| Restore to a new location | SP 800-209 IS-SS-R7: recovery copies "should be restored (pushed) onto an isolated staging (or air-gapped) environment rather than directly onto the target hosts or applications" |
--target pointing at an empty staging directory |
| Verify every file | Compare each restored file against a hash manifest taken before the event. In the lab, the pre-event snapshot gave 10 of 10 SHA-256 matches | your own manifest check |
| Read the data, not only the index |
restic check checks structure. In the lab, a pack with one flipped byte passed a plain check (exit 0) and failed check --read-data (exit 1, "ciphertext verification failed") |
restic check --read-data, or --read-data-subset=n/t to spread the cost |
| Treat unknown exit codes as failure | restic's scripting documentation: "If an unknown exit code is returned, then it MUST be treated as a command failure." | check $? in the wrapper |
| Measure | Restore duration and data age feed the RPO and RTO record | see RPO & RTO validation |
restic exit codes documented in 075_scripting.rst at v0.20.0:
| Code | Meaning |
|---|---|
| 0 | Command was successful |
| 1 | Command failed |
| 2 | Go runtime error |
| 3 |
backup could not read some source data, or forget could not remove one or more snapshots |
| 10 | Repository does not exist (since 0.17.0) |
| 11 | Failed to lock repository (since 0.17.0) |
| 12 | Wrong password (since 0.17.1) |
| 130 | Command was cancelled |
A minimal restore-test sequence with placeholder values:
# Placeholders: repository URL, password file, snapshot ID and staging path are examples.
export RESTIC_REPOSITORY='rest:https://backup.example.test:8000/finance/'
export RESTIC_PASSWORD_FILE=/etc/restic/finance.pass
restic snapshots # choose the last snapshot taken before the event
restic check --read-data-subset=1/5 # spread full data checks across runs
restic restore 1a2b3c4d --target /srv/restore-staging/finance --dry-run -vv
restic restore 1a2b3c4d --target /srv/restore-staging/finance
echo "restic exit code: $?"Then compare the staged files with your pre-event hash manifest before anything is copied back to production.
SP 800-209 RA-SS-R8 says to "Periodically validate that the backup copies are in good health", with frequency matching data sensitivity "but no less than once per year", and suggests a sample rate about 1 to 1.5 orders of magnitude lower than the backup frequency (its examples: "hourly copies validated daily, daily copies by-weekly to monthly"). RA-SS-R5 adds: "Perform a periodic test restore to ensure that it is completed successfully and that it meets the required timeframe."
- Destructive-event evidence collection: preserve evidence before restoring
- RPO & RTO validation
- Known-clean rebuild
- README.md - Recovery section index
- labs/backup-restore/README.md - CI-verified append-only backup and restore lab
- ../../PlayBooks/cybersecurity_playbooks.md - Ransomware incident playbook (prevention checklist mentions the 3-2-1 rule)
โฌ ๏ธ Recovery index | Incident Response index | Master Index | ๐ฏ Role Navigation | Legal Notice
๐ Source: IncidentResponse/Recovery/backup-isolation-and-restore-testing.md | โ๏ธ Suggest an edit | โฌ
๏ธ Back to Incident Response
- ๐บ๏ธ Browse by Topic
- ๐ All Repository Files
- ๐งญ Learning Paths
- ๐ Master Guide
- ๐ค Glossary
- โ๏ธ Legal & Disclaimer
๐ Foundations & Learning
๐ก๏ธ Defense & Investigations
- Incident Response
- Open Source Intelligence (OSINT)
- Reverse Engineering
- Operations Security (OPSEC)
- Compliance
โ๏ธ Platforms & Infrastructure
๐ก Hardware, Wireless & Field Projects
- PNWC Cyberdeck
- Hardware Testing
- Hardware Hacking
- Software-Defined Radio
- Wardriving
- uConsole
- Space Security
๐งฐ Assessment & Field Reference
๐ฆ Downloads & Project Resources
๐๏ธ Additional Topics