How do you protect AWS backups from ransomware or a deleted account?
By the Keel team · Last checked · 6 min read
Short answer
Keep a copy of your backups outside your production account and make it impossible to delete early. In AWS Backup that means a cross-account copy into a separate backup account, locked with Vault Lock in compliance mode, or a logically air-gapped vault, which is always compliance-locked. If attackers or a mistake wipe production, the locked copy survives.
How do you protect AWS backups from ransomware or a deleted account?
Put a second copy of your backups where production credentials cannot reach it, and lock it so nobody can delete it early.
Put a second copy of your backups somewhere your production credentials cannot reach, and lock it so that nobody can delete it early. Three controls do this on AWS: a separate backup account, AWS Backup Vault Lock, and optionally a logically air-gapped vault.
This post adds that layer. For the broader recovery drill, including a ransomware scenario, see running a disaster recovery drill, and for proving the restore works, how to prove your AWS backups restore.
Which threats should the backup setup plan for?
Plan for anyone or anything that can delete data using your production access, not only for ransomware.
Plan for anyone or anything that can delete data using your production access, not only for ransomware. Backups that live in the same account as the database are exposed to every one of these.
- Stolen administrator credentials used to delete data and then its backups.
- A compromised CI pipeline with broad permissions.
- Someone closing the account or losing access to it.
- A well-meant clean-up script that deletes too much.
RDS automated backups sit with the instance, and if you delete an instance they go with it unless you chose to retain them. That is fine for everyday recovery and not enough for these threats.
How does AWS Backup Vault Lock work?
Vault Lock stops anyone deleting backups in a vault before their retention ends, in governance or compliance mode.
Vault Lock stops anyone deleting backups in a vault before their retention ends, and can enforce minimum and maximum retention on new backup and copy jobs. It has two modes: governance, which people with the right IAM permissions can still change, and compliance, which becomes permanent.
| Governance mode | Compliance mode | |
|---|---|---|
| Set up by | Omitting the grace time | Setting ChangeableForDays, from 3 to 36,500 days |
| Who can remove the lock | Users with enough IAM permissions | Anyone allowed, during the grace time only |
| After the grace time | Still removable with permissions | Immutable: no user, root included, and not AWS, can change or delete it |
| Vault deletion | With the right permissions | Only if the vault is empty |
Retention limits apply to new jobs only, and existing recovery points keep their earlier lifecycle. Locked backups still incur standard storage charges until their lifecycle ends, so choose retention carefully. Start in governance mode while you test, then move to compliance with a grace time long enough to catch mistakes.
aws backup put-backup-vault-lock-configuration \
--backup-vault-name prod-locked-vault \
--changeable-for-days 7 \
--min-retention-days 14 \
--max-retention-days 35What is a logically air-gapped vault, and when is it the better choice?
A logically air-gapped vault stores backups in an AWS Backup service-owned account and is always locked in compliance mode.
A logically air-gapped vault is a secondary AWS Backup vault type that stores backups in an AWS Backup service-owned account and is always locked in compliance mode. It suits you when you want isolation without running a backup account yourself.
- Each vault has a minimum retention of at least 7 days and a maximum, and backups outside that range cannot be copied in.
- Encryption uses an AWS owned key by default, or a customer managed key chosen at creation and fixed afterwards.
- You can share a vault through AWS Resource Access Manager with individual account IDs, and a recipient account can restore from it. Organizations and OUs are not supported.
- Check the feature availability table for your resource types before you design around it.
aws backup create-logically-air-gapped-backup-vault \
--backup-vault-name prod-air-gapped \
--min-retention-days 7 \
--max-retention-days 35A cross-account vault with Vault Lock gives you more control and familiar tooling. An air-gapped vault gives you stronger separation from your own organisation, which matters if the whole organisation, not just production, could be compromised.
Do you need a separate backup account?
For a team of 3 to 15 developers, yes: a separate account in your AWS Organization is the simplest strong control.
For a team of 3 to 15 developers, yes: a separate account in your AWS Organization is the simplest strong control, because production credentials simply do not exist there. AWS Backup cross-account copy requires the source and destination to be in the same organization.
- The management account enables cross-account backup in AWS Backup settings.
- In the backup account, create a vault that is not the default one, give it a customer managed key, and add a resource policy allowing
backup:CopyIntoBackupVaultfrom production. - In production, add a copy action to the backup plan, with a role that can copy from and into vaults.
- Apply Vault Lock to the destination vault.
- Attach a service control policy to the backup account denying
organizations:LeaveOrganization, so it cannot leave with its backups.
AWS Backup cannot restore a recovery point directly into a different account. You copy it back, or restore from the backup account itself, so rehearse that path. How many AWS accounts a startup needs covers where this account fits.
Who should have access to the backup account, and what should you alert on?
As few people as possible, and none of your deploy roles.
As few people as possible and none of your deploy roles: no CI pipeline, one or two named administrators with MFA, and a restore role that can read and restore but not delete. Keep its root credentials separate from production's.
Alert on the actions that precede a loss and send them where someone sees them out of hours. CloudTrail records these AWS Backup API calls.
DeleteRecoveryPointandDeleteBackupVault.PutBackupVaultAccessPolicyandDeleteBackupVaultLockConfiguration.- Changes to backup plans, and backup jobs that fail or stop running.
- Sign-ins to the backup account.
Keep the other things you would need to rebuild too: infrastructure as code in version control, the secrets and configuration the app needs, and the access recovery details for the backup account.
How do you test the worst case?
Once or twice a year, restore from the separate copy as if production were gone, and record how long it takes.
Once or twice a year, restore from the separate copy as if production were gone, using only the backup account, and record how long it takes. The first run usually shows a missing key, role or setting.
How often to test database restores gives a rhythm for the routine tests, and what AWS Backup restore testing misses explains what automated testing cannot see.
Would your backups survive a bad day?
Tick each item that is true today.
- A copy of production backups lives in a separate AWS account.
- That copy is protected by Vault Lock or sits in a logically air-gapped vault.
- No CI pipeline or everyday deploy role can reach the backup account.
- You get an alert when a recovery point or vault is deleted.
- You have restored from the separate copy alone in the last year.
- Infrastructure code and secrets needed to rebuild are stored safely too.
Decision point: Five or six ticks: a stolen admin login cannot wipe your history. Three or fewer: your backups share a fate with production.
Sources
- AWS docs, AWS Backup Vault Lock (checked November 2026)
- AWS docs, Logically air-gapped vault in AWS Backup (checked November 2026)
- AWS docs, Creating backup copies across AWS accounts (checked November 2026)
Keep reading
Keel is an AWS release and recovery operations service for SaaS teams of 3 to 15 developers, provided by Bargainn Services Ltd, a UK company registered at Companies House (16497746). Registered office: 3rd Floor, 86-90 Paul Street, London, EC2A 4NE, United Kingdom.