Skip to content

Secure backups on AWS: retention, encryption and incident recovery

A backup the attacker can delete is not a backup. See how to make recovery something you can rely on.

Reading time
9 min
Published

Backups are the last line of defense against data loss, serious failures and ransomware. The problem is that many backups fail exactly when someone needs them, because the attacker managed to delete them, because retention was too short or because nobody ever tested a restore. So a secure backup takes more than the copies themselves: they have to survive an incident and actually be restorable.

For secure backups on AWS, the focus is resilience. That covers retention and encryption, isolation of the copies and protection against deletion, and ends with restore tests, which show whether everything works. With these precautions, recovery stops being an assumption and becomes a real capability.

Strategy, RPO and RTO

Start with the objectives. RPO indicates how much data you can tolerate losing, and RTO how long you can tolerate being unavailable. These numbers drive backup frequency and the recovery architecture (the lower the RPO, the more often copies need to be made). AWS Backup centralizes policies for several services and standardizes frequency, retention and encryption in one place, which makes governance and auditing easier.

Think in layers of defense. Frequent backups handle recent recovery, and copies with longer retention cover compromises that are only discovered weeks later. A ransomware incident can lie dormant for quite a while, and by then the most recent backups already carry the problem. Relying on them alone is risky.

Isolation and deletion protection

Against ransomware and against an attacker with access to the account, the most important control is preventing backups from being deleted. Copy them to a separate, isolated account with different permissions, and use immutability or vault lock mechanisms that prevent deletion during the retention period. Think of it this way: if whoever compromises production can also delete the backups, the protection exists only on paper.

  • Copy backups to a separate, isolated account
  • Apply immutability or a lock for the entire retention period
  • Separate the people who administer production from those who administer backups
  • Encrypt backups while keeping control of the key
  • Keep retention long enough to cover dormant incidents

Strengthen isolation by using policy to deny the actions that delete recovery points and vaults. An SCP applied to the backup account, or the vault access policy, prevents deletion even by someone with administrative credentials. And that is exactly the situation of an attacker who has already compromised the account: they have the credentials, but the policy blocks the deletion.

Policy that denies deletion of recovery points and backup vaults
{  "Effect": "Deny",  "Action": [    "backup:DeleteRecoveryPoint",    "backup:DeleteBackupVault",    "backup:PutBackupVaultAccessPolicy"  ],  "Resource": "*"}

Vault Lock and immutability in practice

AWS Backup offers Vault Lock, which makes a vault's recovery points immutable during retention. In compliance mode, not even the root account can delete a backup before its time is up. It is the strongest control against deletion by ransomware or by a compromised administrator, but it comes at a price: the mode is irreversible and requires planning.

The grace period before the lock

Vault Lock has a grace window defined in its configuration. Until it ends, you can still adjust or remove the lock, and that is the interval in which you validate the retention rules before they become permanent (in the command below, the window is 3 days, set by the --changeable-for-days parameter). After that period, compliance mode becomes immutable, so choose the minimum and maximum retention carefully, because once they take effect there is no going back.

Vault Lock applied with a grace window before it locks
aws backup put-backup-vault-lock-configuration \  --backup-vault-name isolated-vault \  --min-retention-days 30 \  --max-retention-days 365 \  --changeable-for-days 3

Encryption and restore testing

Encrypt backups and control who can decrypt them. Remember that a copy stored in another account can only be restored if there is proper access to the key, so include that in the plan. Above all, test restores periodically. Until a backup has been restored, it is an assumption. The test confirms that the data is intact, that the procedure works and that the RTO is realistic. Also document the recovery procedure, so it does not depend on a single person.

Coverage: what is left without a backup

Worse than a badly configured backup is the resource nobody included in the plan, because that failure is silent. A new database, a volume created in a hurry or an account recently added to the organization can go months without any copy, and that only shows up on the day of the restore. That is why checking coverage is as important as protecting the copies that already exist.

Tag-based backup plans help a lot. Instead of listing each resource, the plan selects everything that carries a defined tag, and new resources are protected as soon as they receive the tag at creation. AWS Backup Audit Manager completes the picture: it measures compliance and points out the resources that should have backups but do not.

  • Select resources by tag so new assets join the plan
  • Audit coverage and flag resources without backups
  • Include the organization's new accounts in the backup policy
  • Review coverage after significant architecture changes

Practical checklist

  • Define RPO and RTO for each critical workload
  • Centralize policies in AWS Backup where applicable
  • Combine frequent backups with long-retention copies
  • Copy backups to a separate, isolated account with different permissions
  • Apply Vault Lock or another lock during retention
  • Deny deletion of recovery points and vaults through policy
  • Separate production administration from backup administration
  • Encrypt backups and keep control of the key
  • Verify key access for restoring cross-account copies
  • Use tag-based selection so new assets join the plan
  • Audit coverage and point out resources without backups
  • Test restores periodically
  • Keep the recovery procedure documented

Best practices

  • Design backups to survive whoever compromises the account
  • Isolate copies in a separate account with different permissions
  • Use Vault Lock in compliance mode against deletion by ransomware
  • Combine short and long retention to cover dormant incidents
  • Select resources by tag and audit coverage
  • Test restores, not just backup creation
  • Document recovery so it does not depend on a single person

Common mistakes

Backups in the same account, with no deletion protection
Whoever compromises the account deletes the data and, for good measure, the backups.
New resources left out of the backup plan
The missing copies of these assets only come to light on the day of the restore, when it is already too late.
Retention that is too short
When the incident is discovered late, no clean recovery point is left.
Never testing restores
Recovery fails in the real incident, and the planned RTO proves unrealistic.
Unencrypted backups
A copy of the data sits exposed, far from the controls that protect production.
Undocumented recovery procedure
The restore rests in the hands of a single person and stalls under pressure.

Authorship and review

Cesar Gargiulo

CEO and founder of GUARDIASEC. Technical and editorial lead for the content published in this library.

Published on . Found a technical error? Write to [email protected] and we will correct it and keep a record of the change.

Frequently asked questions

Why copy backups to another account?
Because an attacker who compromises the production account usually tries to delete the backups, either to force payment of the ransom or to prevent recovery. With copies in a separate, isolated account, with different permissions and immutability, the backups survive the compromise of production. Without that isolation, the protection is only apparent.
What is backup immutability and why does it matter?
Immutability prevents a backup from being changed or deleted during the retention period, even by someone with administrative permissions. That counts for a lot against ransomware and against an attacker with access to the account, who would try precisely to delete the recovery points. With immutability, a clean copy is left to restore.
How often should I test restores?
Periodically, and always after significant architecture changes. A backup that has never been restored is an assumption. The test confirms that the data is intact, that the procedure works and that the recovery time is realistic. Without it, teams often find out only during the incident that the backup was incomplete or that the planned RTO was not achievable.
Does a recent backup solve a ransomware attack?
Not always. A compromise can lie dormant for weeks before anyone notices, and very recent backups may already contain the problem. So the recommendation is to combine frequent backups with isolated copies that have longer retention. This raises the chance that a recovery point from before the compromise exists.
What is AWS Backup Vault Lock?
It is the feature that makes a vault's recovery points immutable during retention. In compliance mode, not even the root account can delete a backup before its time is up, and that is the strongest protection against deletion by ransomware or by a compromised administrator. Vault Lock has an initial grace window, defined in the configuration, during which you can still adjust the rules. Once that period is over, the lock becomes permanent, so choose the minimum and maximum retention carefully.
How do I make sure no resource is left without a backup?
Prefer backup plans that select resources by tag instead of listing them one by one. A new asset is then protected as soon as it receives the defined tag at creation, without depending on someone remembering to include it. Complement this with AWS Backup Audit Manager, which measures compliance and points out the resources that should have backups but do not. And review coverage after significant architecture changes and when adding accounts to the organization.
Does an SCP that denies backup deletion get in the way of legitimate operations?
Not if it is well designed. The idea is to block only destructive actions on recovery points and vaults, such as deleting recovery points or changing the vault access policy, and leave normal create and restore operations untouched. Backups still expire through the retention rule of the plan itself. What the policy prevents is early manual deletion, which is exactly the step an attacker would try to take.

When to bring in specialist help

Designing backups that withstand a compromise and validating recovery is part of two GUARDIASEC services: AWS Security, and Monitoring and Response. In both, we assess the isolation of the copies, the retention settings and how ready you are to restore.