Skip to content

Backup Isolation and Restore Testing

github-actions[bot] edited this page Nov 29, 2026 · 1 revision

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

๐ŸŽฏ Purpose

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.

โš™๏ธ Function

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.

๐Ÿ† Goal

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".

๐Ÿ“‹ When To Use

  • 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.

๐Ÿ“ Copy Rules

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.

๐Ÿ”’ Isolation Options

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."

Append-Only In Practice (rest-server)

Read from repo/repo.go at rest-server v0.15.0 and confirmed in the lab's CI run:

  • The README says: "The --append-only mode allows creation of new backups but prevents deletion and modification of existing backups."
  • With --append-only, DELETE of the repository config and 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 is DELETE: allowed without the flag, refused with it.
  • In the lab, restic forget and restic forget --keep-last 1 --prune against 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, forget exited 0 and removed the snapshot.
  • Without --no-auth (and without --proxy-auth-username), rest-server refuses to start if its .htpasswd cannot be loaded. The lab used --no-auth on loopback only; production needs authentication, --private-repos and TLS.

restic's own documentation (060_forget.rst, "Security considerations in append-only mode") adds two rules:

  1. forget and prune "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.
  2. An attacker who can add snapshots can make legitimate ones fall outside --keep-last or --keep-weekly windows. On append-only repositories, use --keep-within.

Object Lock In Practice (Amazon S3)

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:BypassGovernanceRetention can override retention by sending x-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:PutObjectLegalHold removes it.
  • A DELETE that names a locked version is refused with 403. A DELETE without a version ID succeeds and only adds a delete marker; the locked version remains.

๐Ÿงช Restore Testing

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.

๐Ÿ” How Often To Validate

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."

See also

Related Files


โฌ…๏ธ 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

Clone this wiki locally