Skip to content

InsightsCloud

AWS Backup Vault Lock: making backups that an administrator cannot delete

How governance and compliance mode differ, why the grace time is the part to plan, how retention limits interact with your backup plans, and the gaps that a locked vault still leaves open.

Published November 22, 20266 min read

A backup that the production credentials can delete is not much of a backup. Ransomware operators and careless scripts both go looking for backups first, and an administrator role in the same account can usually remove them. Disaster recovery that works when you need it says to copy backups to a separate account and lock them. This article is about the locking: what AWS Backup Vault Lock does, the one decision in it that cannot be undone, and what it does not protect.

What a lock does

Vault Lock is an optional setting on an AWS Backup vault. It makes the vault write-once, read-many: recovery points stay until their lifecycle ends, and anyone who tries to delete one early or shorten its retention is refused, including the account's root user (AWS Backup Vault Lock). Each vault can have one lock.

It has two modes:

Governance modeCompliance mode
Who can remove the lockUsers with sufficient IAM permissionsNobody, once the grace time ends
Can the vault be deletedYes, by those usersOnly if it is empty and holds no recovery points
Grace timeNoneYou choose it, at least 3 days
FitsStopping mistakes and ordinary deletionsProtection against stolen credentials, and retention you are obliged to keep

Governance mode protects against accidents and against people without the right permissions. It does not protect against an attacker who has obtained those permissions, because they can remove the lock and then delete. Compliance mode is the one that holds up against a compromised administrator, and it is also the one you cannot back out of.

The grace time is the decision

In compliance mode, the lock has a cooling-off period that you set when you create it. During that period you can change the configuration or delete the lock. When it ends, the vault and its lock are immutable: no user and no AWS support request can change or remove them, and the vault cannot be deleted while it contains recovery points.

The API controls this with one parameter. Include ChangeableForDays (3 to 36,500) and you get compliance mode; leave it out and you get governance mode.

lock-vault.sh
# Compliance mode: changeable for 7 days, then immutable
aws backup put-backup-vault-lock-configuration \
  --backup-vault-name dr-tier2 \
  --changeable-for-days 7 \
  --min-retention-days 35 \
  --max-retention-days 90

Because omitting a parameter changes the mode, a copied command or a Terraform block with a missing line produces a different lock from the one you intended. In Terraform it is the same argument:

vault-lock.tf
resource "aws_backup_vault_lock_configuration" "dr_tier2" {
  backup_vault_name   = aws_backup_vault.dr_tier2.name
  min_retention_days  = 35
  changeable_for_days = 7 # remove this line and the lock is governance mode
  max_retention_days  = 90
}

Retention limits and the plans that write to the vault

The lock can also carry a minimum and a maximum retention, in days. They apply to new backup and copy jobs: a job whose lifecycle is shorter than the minimum or longer than the maximum fails. Recovery points that are already in the vault are not affected, and keep the lifecycle they had.

That makes the limits a place where backup plans quietly break. If your plan copies recovery points into the locked vault with a 14-day lifecycle and the vault minimum is 35, the copy jobs fail. A failed copy is easy to miss, so check this before the grace time ends:

  • Set the vault's minimum to the shortest retention you really need to guarantee, not to the longest.
  • Make every plan rule that copies into the vault use a delete_after inside the range.
  • Alert on failed copy jobs, as you would on failed restore tests.

The documentation also warns about recovery points with retention set to "Always". After the grace time, they are kept forever and cannot be altered or deleted, and you pay storage for them. Check for them before the lock becomes permanent.

In the plan from the earlier article, the copy action would look like this once the vault above is in place:

backup.tf
copy_action {
  destination_vault_arn = aws_backup_vault.dr_tier2.arn
 
  lifecycle {
    delete_after = 35 # within the vault's 35 to 90 day range
  }
}

What the lock does not cover

Vault Lock governs what happens through AWS Backup. Three gaps are worth closing by other means.

The account itself. If an account that contains a locked vault is closed, AWS suspends it for 90 days with the backups intact. If it is not reopened in that time, AWS deletes the vault contents even when a lock was in place. Treat closing the backup account as a controlled operation, with few people able to do it, rather than relying on the lock.

EC2 and EBS side doors. The vault lock and vault access policies do not govern sharing or storage tier changes made directly through the EC2 APIs. An EBS snapshot recovery point can still be shared with ModifySnapshotAttribute, and its tier changed with ModifySnapshotTier. EC2 still cannot delete snapshots that AWS Backup manages. The documentation's advice is to deny both actions with IAM policies or SCPs, while exempting the roles your backup plans use, because AWS Backup itself uses them for cross-account copies and cold storage transitions.

Disabled images. A disabled AMI can block the restore of EC2 recovery points, locked or not. The recovery points cannot be deleted, but they can be unusable until the AMI is re-enabled. The guidance is to deny ec2:DisableImage with IAM policy.

Retention also does not substitute for access control. Combine the lock with a vault access policy that limits who can write and copy into the vault, with encryption of recovery points, and with the permissions discipline described in Least-privilege IAM in practice.

Checking that the lock is on

A lock that someone assumed was applied is the usual failure. Read it back:

verify-lock.sh
aws backup describe-backup-vault --backup-vault-name dr-tier2 \
  --query '{locked: Locked, min: MinRetentionDays, max: MaxRetentionDays, lockDate: LockDate}'

Locked is true from the moment a lock exists, including during the grace time. LockDate is the UTC time at which the grace time ends. For a standing check across many accounts, AWS Backup Audit Manager has a control for resources that are in a backup plan with a Vault Lock, which turns the question into a report.

A rollout order

  1. Create a separate backup account and a destination vault in it, in another Region if your recovery tier requires it.
  2. Start with governance mode in a test vault, to see which backup and copy jobs fail against the retention range.
  3. Choose the range from your tiers, and align the delete_after of every plan that copies into the vault.
  4. Lock in compliance mode with a grace time of at least a week, and run a full copy and restore during it.
  5. Close the side doors with IAM policies or SCPs for snapshot sharing, tier changes and ec2:DisableImage.
  6. Audit continuously, with Locked checked per vault and failed copy jobs alerted on.

What changes

After the lock, deleting a backup stops being something a stolen administrator role can do, and the retention you promised is a property of the vault rather than of a policy document. The price is permanence: the retention range and the storage it implies are fixed once the grace time ends, so the time to be careful is the first week, not the first incident.