Skip to content

Lesson 6 of 9 · 25m

Encryption, Immutability, and Ransomware-Resistant Backup Design

Protect backup confidentiality and integrity with separated keys, least-privilege writers, immutable retention, and deletion-resistant operational design.

Ransomware changed backup design because attackers changed their target. Modern intrusions look for backups first. If the production host can mount, list, overwrite, or delete the backup repository, encryption at rest is not enough. The question is not merely 'is the backup encrypted?' It is 'what can a compromised production identity do to the backup history?'

Encrypt before trusting the storage system

Server-side encryption is useful but often controlled by the same account and operators as the storage. Client-side encryption gives you a clearer boundary. Tools such as restic encrypt before upload:

export RESTIC_REPOSITORY=s3:https://s3.us-east-1.amazonaws.com/company-backup-vault
export RESTIC_PASSWORD_FILE=/run/secrets/restic-password
restic init && restic backup /srv/app-data --tag nightly

Do not copy this blindly into production; the point is the shape. The repository password and storage credential are separate controls with separate rotation and custody.

Key management is restore design

An encrypted backup without keys is secure garbage. Record:

key id/custody  restic-main-2026-q4; offline manager + sealed recovery copy
rotation/access quarterly and after operator departure; break-glass backup admins
dependency      required before any repository read

Test the break-glass path. A key protected so well that nobody can use it during a crisis is not availability engineering.

Writer identity should not be destroyer identity

The service performing nightly backups often needs only object creation. It does not need deletion, policy modification, or retention changes. A least-privilege policy should distinguish write, read-for-restore, prune, and administer. Ideally, pruning runs from a separate maintenance role unavailable to production hosts.

{"Effect":"Allow","Action":["s3:PutObject"],"Resource":"arn:aws:s3:::company-backup-vault/nightly/*"}

This simplified policy omits necessary list or multipart permissions depending on the uploader. Use it as a design sketch, then verify exact tool requirements.

Immutability buys time, not immunity

Object lock, worm storage, offline media, and append-only repositories all make history harder to destroy. Attackers respond by attacking the control plane, waiting out short retention, or corrupting future backups. Therefore pair immutability with identity separation, MFA, alerting, and periodic restore validation.

Protect the backup software configuration too

If an attacker can edit the job definition, they can change the source path to an empty directory while leaving success notifications intact. Store backup configuration in version control, restrict deployment credentials, alert on source-size anomalies, and review unexpected changes to retention or excludes.

sources:
  - path: /srv/app-data
    excludes: [cache/**, tmp/**]
retention: {keep_daily: 14, keep_weekly: 12}

An unnoticed one-line exclude can be more damaging than an exploit of the backup server itself.

Field notes

  • Test restore with only the disaster-recovery credentials; hidden dependence on admin accounts is common.
  • Key rotation must not orphan old recovery points unless re-encryption or documented legacy key retention exists.
  • Immutability windows shorter than intrusion dwell time may expire before discovery.
  • Backup deletion alerts matter only if someone can act before retention destruction completes.
  • Ransomware resilience includes rebuilding clean systems; restoring infected or maliciously altered data re-imports the incident.

Was this lesson helpful?

Sign in to rate