Lesson 4 of 6 Data Integrity, Backup and Retention

Protecting Backups Against Ransomware with AWS Backup

This lesson explains how backups, the last line of defence against ransomware and destructive attacks, are made immutable, isolated and tested so that the attacker cannot destroy them too.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe the basic features of AWS Backup.
  • Protect backups with Vault Lock, copies to other accounts and logically air-gapped vaults.
  • Describe how Data Lifecycle Manager, Recycle Bin and snapshot locks protect EBS snapshots.

AWS Backup basics

AWS Backup centralises backups across AWS services and accounts. The following list describes its basic features.

  • Central backups for EC2, EBS, RDS, Aurora, DynamoDB, EFS, FSx, S3, DocumentDB, Neptune, Storage Gateway and more.
  • Backup plans: schedules, retention, cold storage; resource assignments by tag or ID.
  • Organisation backup policies deploy plans across accounts; Backup Audit Manager reports compliance.
True or false

AWS Backup basics

Exam skills 5.2.4

Check how AWS Backup is organised.

Log in to try this activity Interactive activities are free with an account.

Protecting backups from attackers

Ransomware attackers try to delete or encrypt backups before they encrypt production data, so that the victim cannot recover. Copy rules place recovery points in other Regions and, importantly, in a dedicated backup account, encrypted with separate KMS keys. Compromising the production account then does not reach the copies. AWS Backup Vault Lock in compliance mode becomes permanent after a grace period: nobody, not the root user and not AWS, can delete recovery points before their retention ends or change the lock. In governance mode, users with the right permissions can still manage the lock, which suits testing.

Logically air-gapped vaults hold immutable copies isolated from your accounts and encrypted with AWS owned keys. They are shared through AWS RAM with a recovery account, so data can be restored even if the source account is lost. Restore testing regularly restores backups automatically to prove they work. The following table summarises the controls.

ControlProtection
Copy rulesRecovery points copied to other Regions and accounts (a dedicated backup account), with separate KMS keys
Vault Lock, compliance modeAfter a grace period, nobody (root or AWS) can delete recovery points early or change the lock
Vault Lock, governance modeAuthorised users can still manage the lock
Logically air-gapped vaultsImmutable, isolated copies with AWS owned keys, shared via RAM with a recovery account
Restore testingAutomatic, regular restores proving backups work

The following diagram shows backups copied into a locked vault in a separate backup account, so they survive an administrator-level compromise.

Backups that survive an administrator-level compromise. Every production account's backup plan copies recovery points to a dedicated backup account in another Region, into a vault whose access policy admits only principals from the organisation and whose compliance-mode lock cannot be changed after three days.
The scenario is illustrative.
Match the pairs

Ransomware-resistant backups

Exam skills 5.2.4

Match each AWS Backup control with the protection it provides.

Log in to try this activity Interactive activities are free with an account.

EBS-specific protections

Three features protect EBS snapshots and AMIs specifically. Amazon Data Lifecycle Manager automates creating snapshots and AMIs on a schedule, deleting them when their retention ends, and copying them to other Regions or accounts. EBS snapshot lock makes snapshots immutable for a period, in governance or compliance mode, so they cannot be deleted even by administrators. Recycle Bin keeps deleted snapshots and AMIs for a retention period, according to rules you set, so an accidental or malicious deletion can be reversed. The following table summarises the features.

FeatureUse
Data Lifecycle ManagerAutomates EBS snapshot and AMI creation, retention and cross-Region or cross-account copies
EBS snapshot lockMakes snapshots immutable
Recycle BinRetains deleted snapshots and AMIs so deletions can be reversed
Match the pairs

Protecting snapshots and AMIs

Exam skills 5.2.4

Match each EBS protection feature with its use.

Log in to try this activity Interactive activities are free with an account.
Worked example

Backups an attacker cannot destroy

A ransomware playbook assumes the attacker gains administrator access to a production account. Backups in that account are therefore not enough. The design copies every recovery point to a dedicated backup account in another Region, into a vault locked in compliance mode:

# In the backup account (999999999999)
aws backup create-backup-vault --backup-vault-name org-immutable --encryption-key-arn $BACKUP_ACCOUNT_KEY
aws backup put-backup-vault-access-policy --backup-vault-name org-immutable --policy '{
  "Version": "2012-10-17",
  "Statement": [{ "Effect": "Allow", "Principal": "*", "Action": "backup:CopyIntoBackupVault",
    "Resource": "*", "Condition": { "StringEquals": { "aws:PrincipalOrgID": "o-a1b2c3d4e5" } } }]
}'
aws backup put-backup-vault-lock-configuration --backup-vault-name org-immutable \
  --min-retention-days 35 --max-retention-days 365 --changeable-for-days 3

The organisation backup policy adds a copy action to this vault in every production account's plan. After three days the lock cannot be changed by anyone. Restore testing then restores a sample of recovery points each week and checks they work, because an untested backup is only a hope.

Check yourself

How are backups copied to another account and Region?

Show answer

With AWS Backup copy rules in the backup plan.

Exam Tips

Remember for the exam

  • When an attacker with administrator access must not be able to delete backups, use Vault Lock compliance mode or a logically air-gapped vault.
  • To copy backups to another account and Region, use AWS Backup copy rules.
  • To automate EBS snapshot schedules and retention, use Data Lifecycle Manager.
  • To recover accidentally deleted snapshots, use Recycle Bin.
  • To prove that backups can be restored, use AWS Backup restore testing.