Skip to content
Tutorials Center
My learning

Topics

Lesson 67 of 80 ยท Privacy, Cloud and Secure Design

Backups, Resilience and Business Continuity

Learn the 3-2-1 backup rule, ransomware-proof recovery, RTO and RPO, disaster recovery testing and backup verification with hashes, with Python demos.

Every other control in this course tries to stop bad things from happening. Backups and recovery plans are for the day they happen anyway: a disk fails, an administrator deletes the wrong database, a region goes offline, or ransomware encrypts every file it can reach. Whether that day is a bad afternoon or the end of the company depends on one question: can you get your data and your services back, how fast, and how much will you have lost?

This lesson covers the backup rules that work, the two numbers that define recovery goals (RTO and RPO), why ransomware changes how backups must be built, and how to prove a backup is usable instead of hoping it is. It connects to availability from The CIA Triad and Core Principles, to ransomware in Malware Types and How They Spread, and to the recovery phase of The Incident Response Process.

Resilience, continuity and recovery

Three related terms are often mixed up.

  • Backup: a separate copy of data that lets you restore it after loss or damage.
  • Disaster recovery (DR): the technical plan and tooling to restore systems after a major failure.
  • Business continuity (BC): the wider plan to keep the organization working during an outage, including people, manual workarounds, suppliers and communication.

Resilience is the goal behind all three: the ability to absorb a failure and keep serving users. Replication across zones is not a backup, because it faithfully copies a deletion or a corruption within seconds. A backup protects against mistakes and attacks; redundancy protects against hardware failure. You need both.

The 3-2-1 rule

The classic rule of thumb is short enough to remember at 3 a.m.:

  • 3 copies of your data (the live data plus two backups),
  • on 2 different kinds of media or storage systems,
  • with 1 copy off-site (another building, region or provider).

Ransomware added two more ideas, giving the 3-2-1-1-0 rule:

  • 1 copy that is offline, air-gapped or immutable, meaning it cannot be changed or deleted for a set time even with administrator credentials. Object-lock or write-once storage and tape in a vault are examples.
  • 0 errors: backups are regularly restored and verified, not just written.

The reason for the immutable copy is that attackers know backups are the victim's way out. Modern ransomware operators look for backup servers and delete or encrypt them first, using stolen administrator accounts. A backup that the same credentials can erase is not a safe backup. Keep backup credentials separate from your normal domain and cloud admin accounts, protect them with MFA, and keep the backup network reachable only for the backup jobs.

Python Check an inventory against 3-2-1-1-0

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The orders database, probably the most valuable asset in the list, has the weakest protection: two copies in one office, no immutable copy and no restore test. Inventories like this one show where money and attention should go first.

RTO and RPO: setting recovery goals

Two numbers turn "we need good backups" into a design you can build and test.

  • RPO (Recovery Point Objective): the maximum amount of data you can afford to lose, measured in time. If the RPO is one hour, your last usable copy must never be older than one hour when disaster strikes.
  • RTO (Recovery Time Objective): the maximum time a service may stay down. If the RTO is four hours, you must be serving users again within four hours of the failure.
flowchart LR
    B["Last good backup"] -- "data lost = RPO gap" --> F["Failure happens"]
    F -- "downtime = RTO gap" --> R["Service restored"]

RPO looks backwards from the failure to the last good copy; RTO looks forwards to the moment users are served again.

Both are business decisions, not technical ones. A payment system might need an RPO of seconds and an RTO of minutes, which means continuous replication and a hot standby, and costs a lot. An internal wiki might accept an RPO of a day and an RTO of three days, which a nightly backup satisfies cheaply. Ask the owners of each system what an hour of downtime and an hour of lost data really cost, then match the technology to the answer.

Python Does this schedule meet the objectives?

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The second system fails both goals: a six-hour backup interval cannot meet a one-hour RPO, and restoring 800 GB takes six hours at that speed against a four-hour RTO. The fix is architectural (more frequent snapshots or log shipping, faster restore paths, a warm standby), not a promise to "try harder". Always calculate restore time from a measured test, not from the vendor's headline speed.

Backing up against ransomware

Ransomware encrypts your files and demands payment for the key, and many groups also steal data first and threaten to publish it. Backups address the availability half of that threat, but only if they survive the attack. A resilient design includes:

  • Immutable or offline copies that attackers cannot erase, as described above.
  • Versioning, so you can roll back to a point before the encryption started. If the malware ran quietly for days, your newest backup may already contain encrypted files.
  • Separate credentials and networks for backup systems.
  • Monitoring for mass file changes and backup deletion attempts, so you notice early (see Detecting Malicious Behavior).
  • A clean rebuild plan. Restoring data onto machines that are still infected just starts the incident again. Rebuild systems from known-good images, patch them, rotate every credential, and only then restore data.

Encrypted data has a recognizable property: it looks like random bytes. The measure Shannon entropy reaches close to 8 bits per byte for random or well-encrypted data, while ordinary text sits far below. That makes a simple check possible: scan the newest backup and see whether it still looks like real files.

Python Is the newest backup already encrypted?

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Entropy is only a hint, because compressed archives, images and videos are high-entropy by nature. That is why the demo applies the rule to a text file. Real detection compares a file's entropy and type against its own history, and counts how many files changed at once.

Verify backups with hashes

A backup that cannot be restored is worth nothing, and the worst time to learn that is during the disaster. Two kinds of verification matter:

  1. Integrity: are the bytes in the backup identical to what was backed up, and still identical today? Disks rot, transfers fail and attackers tamper. A manifest listing a cryptographic hash per file (see Hash Functions and Integrity) answers this. Store the manifest separately from the backup, ideally signed, otherwise an attacker who can change the files can change the manifest too.
  2. Restorability: can you actually rebuild a working system from the backup within the RTO? Only a real test proves this.
Python A hash manifest finds damaged, missing and extra files

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A single flipped bit changes the whole digest (the avalanche effect from the hashing lesson), so even tiny corruption is caught. Keep in mind that hashes prove the data has not changed since the manifest was made, not that the data was good to begin with.

Testing disaster recovery

Plans that are never exercised fail. A reliable testing ladder, from cheap to expensive:

  • Automated restore checks: every night, restore a sample into a scratch environment and run a query or a smoke test against it.
  • Tabletop exercises: the team talks through a scenario ("the primary region is gone") step by step, finds gaps in runbooks and decides who communicates with customers.
  • Full failover drills: actually switch to the standby site or rebuild from backup during a planned window, and time it against the RTO.

After every test and every real incident, write down what was slow or missing and fix it. Keep the runbooks somewhere that does not depend on the system that is down, and print or replicate the contact list. Also test the human side: who has authority to declare a disaster, who talks to customers and regulators, and how do people communicate if email and chat are unavailable?

Practical guidelines

  • Classify systems by criticality and set an RTO and RPO for each. Do not give every system the most expensive tier.
  • Encrypt backups and protect the keys separately, because a backup is a copy of everything an attacker wants (see Randomness, Key Management and Secrets). Keep retention in line with your privacy obligations: backups are personal data too.
  • Back up SaaS data, cloud configuration and infrastructure code, not only servers. A cloud provider's platform is not a backup of your content.
  • Monitor backup jobs for failure and for sudden changes in size, which can mean a broken job or a ransomware attack.
  • Review the plan whenever systems, staff or suppliers change.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. What does the 3-2-1 backup rule require?

    Three copies including the live data, on at least two media types, with one off-site. Modern guidance adds an immutable or offline copy and verified restores.
  2. 2. A database must not lose more than 15 minutes of data. Which objective is this?

    RPO is the acceptable data loss measured in time. RTO is how long the service may stay down.
  3. 3. Why is a replicated copy in a second region not a substitute for a backup?

    Replication keeps copies in step, including mistakes and ransomware encryption. A backup keeps older points in time you can return to.
  4. 4. Why should the backup manifest with file hashes be stored separately from the backup?

    If both live in the same place, tampering with the files and updating the manifest goes unnoticed. A separate, ideally signed, manifest keeps verification independent.
  5. 5. After a ransomware attack, what is the safest order of recovery steps?

    Restoring onto infected systems restarts the incident. Rebuild clean, fix the entry point, rotate credentials and restore from a point before the encryption began.

Summary

  • Backups protect against mistakes and attacks; replication and redundancy protect against hardware failure. You need both.
  • Follow 3-2-1-1-0: three copies, two media types, one off-site, one immutable or offline, zero unverified restores.
  • RPO is the acceptable data loss in time; RTO is the acceptable downtime. Business owners set them and engineers design to meet them.
  • Ransomware-ready backups need immutability, versioning, separate credentials and a clean rebuild plan.
  • Hash manifests prove integrity, but only regular restore tests prove recoverability. Rehearse disasters before they happen.

Next: Compliance and Security Frameworks, which shows how organizations organize and prove all of these controls.