Cybersecurity Foundations·A security baseline you can use

Backups and recovery

A backup you have never restored is a wish, not a copy.

Beginner 13 min read Lesson 4 of 300 Challenge included
What you will be able to do
  • Keep three copies on two media types with one off-site.
  • Keep at least one copy immutable to survive ransomware.
  • Encrypt backups at rest and in transit.
  • Run regular restore drills and record the steps.

In plain English

The 3-2-1 rule says keep at least three copies of your data, on two different types of storage, with at least one copy off-site, so a single device failure or disaster does not destroy everything. An immutable copy is a backup that cannot be changed or deleted for a set period, which protects it from ransomware, the kind of attack that encrypts your files and demands payment for the key. Encryption protects backup data while it is stored and while it travels, so someone who steals the backup cannot read it without the key. A restore drill is a planned test where you actually recover data from a backup, proving the copy is complete and the process works before you need it in a real emergency. Because restoring is the only part that matters, you should treat an untested backup as if it does not exist.

Step by step

  1. 1List the data that would hurt to lose and where it lives.
  2. 2Set up three copies across two storage types, with one copy off-site.
  3. 3Enable encryption on your backups and store the key separately from the copies.
  4. 4Make at least one copy immutable so ransomware cannot reach it.
  5. 5Run a restore into a temporary location and confirm the data is usable.
backup.shTerminal
restic -r /mnt/backups init
restic -r /mnt/backups backup /var/lib/postgres
restic -r /mnt/backups snapshots
restic -r /mnt/backups restore latest --target /tmp/restore

Common mistakes

  • A backup on the same disk as the original disappears along with it when that disk fails.
  • Skipping restore drills means discovering too late that the backup is incomplete or the process no longer works.
  • Storing the encryption key next to the encrypted backup lets a thief unlock everything in one find.
  • A backup that ransomware can reach and encrypt is just one more file the attacker locks up.
Your turn

Restore from a snapshot

Medium

Write the shell command to restore the latest snapshot of a repository into a temporary directory.

BASH · starter
restic -r /mnt/backups restore
Check your understanding before moving on.
Knowledge checkQuestion 1

What does the 3-2-1 rule mean?

Select an answer to continue
Study tools

Make it yours.

Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.

Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign in
Finished reading?

Lock in what you just learned.

Mark this lesson complete to save your place and move one step closer to the certificate.

Lesson 4 of 300 · 0% of course