Skip to Content
Asterrr's Handbook
5 · Data protection

Immutable storage and Vault Lock

Compare S3 Object Lock, AWS Backup Vault Lock and Amazon Glacier Vault Lock for WORM retention and ransomware-proof backups.

Exam tasks: 5.2.2 (integrity: code signing, file validation), 5.2.4 (secure replication and backup: DLM, AWS Backup, ransomware protection, DataSync)

The decision: if an attacker gets administrator access to a production account, or the whole account is closed, which copy of your data survives, who can restore it, and how do you know the copy is intact?

Three services offer write-once-read-many (WORM) protection. They differ in what they lock and how to back out.

Production accountBackup accountback upcopy jobencryptsDatabaseBackup planLocked vaultSeparate KMS key
Backups are copied to a separate backup account and held in a locked vault, so a production-account compromise cannot delete them.
72 hours
Minimum grace time before a compliance-mode Backup Vault Lock becomes immutable.
7 days
Minimum retention on a logically air-gapped vault.

Comparison

S3 Object LockAWS Backup Vault LockGlacier Vault Lock
ProtectsObject versions in a versioned S3 bucketRecovery points in a backup vaultArchives in a Glacier vault
ModesGovernance, compliance, legal holdGovernance or complianceOne locked policy
Backing outGovernance with bypass permission. Compliance neverGovernance by IAM. Compliance only during the cooling-off grace timeAbort within 24 hours of initiate, never after complete
Retention controlPer version or bucket defaultMin and max retention for the vault (1 to 36,500 days)Vault Lock policy conditions
AvailableYesYesOriginal Glacier vault service is closed to new customers

A ransomware-resistant layout

Workload accountBackup account (separate OU)Recoverycopy action, customermanaged keycopy actioncross-Region copyEBS, RDS,DynamoDB, EFS,S3, FSxLocal backupvault shortretentionVault with Vault Lockcompliance modeLogically air-gapped vaultshared via AWS RAM or MPAVault in DR RegionRestore into a cleanrecovery account
Diagram of a ransomware-resistant layout
  • Backups that live in the same account as production can be deleted by whoever compromises that account. Copy them to an account the workload administrators can't touch.
  • Lock the destination vault so even that account's administrators can't shorten retention.
  • Guard the backup account with SCPs that deny backup:DeleteBackupVault, backup:DeleteRecoveryPoint, backup:PutBackupVaultLockConfiguration changes and kms:ScheduleKeyDeletion on backup keys, except for a break-glass role.

Vault Lock and air-gapped vaults

Vault Lock governanceVault Lock complianceLogically air-gapped vault
Who can remove the lockIAM principals with permissionNobody after the grace time, not even AWSNobody; compliance lock is built in
Grace timeNoneAt least 72 hoursNot applicable
Retention boundsOptional min and maxOptional min (1 day or more) and maxRequired: min 7 days or more, and a max
EncryptionVault keyVault keyAWS owned key by default, or a customer managed key
Restore from another accountCopy back firstCopy back firstYes, share with AWS RAM or recover through multi-party approval
Use forGuardrails while you tune retentionWORM retention for regulators (SEC 17a-4, FINRA)Fast recovery when the owning account is compromised or closed
  • Backups in a locked vault can't be deleted early by anyone, including the root user.
  • Once a compliance lock passes its grace time, the vault can be deleted only when it's empty, so check retention values carefully; a mistake keeps costing money until the recovery points expire.
  • Multi-party approval lets a team of approvers authorise restoring from a logically air-gapped vault into another account even when the owning account is inaccessible.

Exam signal

"Protect backups from a compromised administrator" means cross-account copies to a vault with Vault Lock in compliance mode. "Restore quickly into a new account without copying first, even if the source account is gone" means a logically air-gapped vault shared through RAM or unlocked through multi-party approval.

Two different vault locks

AWS Backup Vault Lock protects recovery points in backup vaults. Glacier Vault Lock was a policy lock on the original Glacier vault service, which no longer takes new customers. S3 Object Lock protects object versions in buckets. Match the lock to the storage the question describes.

AWS Backup Vault Lock details

  • Lock is governance unless you set ChangeableForDays. Setting it makes the lock compliance.
  • Compliance has a cooling-off ("grace time") of 3 to 36,500 days. During it you can change or remove the lock. After it, nobody including AWS can.
  • Min and max retention apply to new backup and copy jobs. Jobs outside the range fail. Existing recovery points keep their lifecycle.
  • Backups in a locked vault cannot be deleted until their lifecycle ends. Avoid recovery points with retention "Always".
  • Assessed for SEC 17a-4, CFTC and FINRA.
  • Vault Lock governs actions through AWS Backup only. Block ec2:ModifySnapshotAttribute and ec2:ModifySnapshotTier with SCPs for EBS recovery points, exempting the backup role.
  • Closing the AWS account suspends it for 90 days, after which even locked vault contents are deleted.

Glacier Vault Lock

  1. initiate-vault-lock with the policy. Returns a lock ID and the lock is in progress for 24 hours.
  2. Test the policy. abort-vault-lock to start over.
  3. complete-vault-lock with the lock ID within 24 hours. Now the policy cannot be changed or deleted.

A vault access policy is for changeable, non-compliance rules. The lock policy is for compliance rules and is immutable.

Legacy: use S3 Object Lock on S3 Glacier storage classes instead

The original vault-based Amazon Glacier service no longer accepts new customers. Its Vault Lock works like this: InitiateVaultLock attaches a policy and starts a 24-hour in-progress window for testing; CompleteVaultLock makes the policy permanent, and it can never be changed or removed. New archives should use S3 Glacier Flexible Retrieval or Deep Archive storage classes in a bucket with Object Lock.

Exam signal

"Protect backups even if the production account is compromised" means Backup Vault Lock in compliance mode plus cross-account copy to a separate account. "Test the policy for a day before making it permanent" means Glacier Vault Lock initiate then complete.

Exam trap

Glacier Vault Lock and AWS Backup Vault Lock are different features. Backup Vault Lock governance mode can be removed by IAM-permitted users, so it is not ransomware-proof alone.

Scenarios

Scenario
A ransomware group gained administrator access to a retailer's production account and deleted RDS snapshots and EBS snapshots stored there. The retailer wants to ensure this can't happen again, and that backups can't be deleted even by administrators of the account that stores them. Which solution meets these requirements?

Further reading

On this page