3.1.1.8. Protecting Data Against Ransomware and Accidental Deletion (S3 Object Lock, EBS Snapshot Lock, AWS Backup Vault Lock)
3.1.1.8. Protecting Data Against Ransomware and Accidental Deletion (S3 Object Lock, EBS Snapshot Lock, AWS Backup Vault Lock)
💡 First Principle: A backup protects against ransomware only if the attacker cannot delete it. The defense is immutability that even a fully privileged administrator cannot undo, held in an account the attacker does not control.
Scenario: After a credentials compromise at a peer company in which the attacker deleted every snapshot before encrypting production, a bank requires that its backups survive an attacker holding administrator, or even root, access to the production account.
| Control | Protects | Governance mode | Compliance mode |
|---|---|---|---|
"S3 Object Lock" | Individual object versions (bucket must have versioning) | Users with the bypass permission can delete or shorten retention | No user, including root, can delete the version or shorten retention until it expires. Legal hold blocks deletion with no end date until removed |
"EBS snapshot lock" | Individual "EBS" snapshots | Locked immediately; users with permission can unlock or change it | Optional cooling-off period of 1 to 72 hours during which it can still be changed; after that it cannot be unlocked or shortened, only extended. Lock duration 1 day to 100 years. The only way to delete early is to close the account |
"AWS Backup Vault Lock" | Every recovery point in a backup vault | Users with sufficient IAM permissions can remove the lock | After a grace time of at least 3 days (72 hours) the lock is immutable: no user or AWS can delete recovery points early or change retention. Minimum and maximum retention reject non-conforming backup jobs |
- Choose by what you back up:
"S3 Object Lock"for data stored as objects (logs, records, exports);"EBS snapshot lock"for snapshots managed outside"AWS Backup"(for example by"Amazon Data Lifecycle Manager");"Backup Vault Lock"when"AWS Backup"manages backups across many services, because one lock covers every recovery point in the vault. - Separate the copy from the attacker: copy backups to a vault in a dedicated backup account (cross-account copy through
"AWS Organizations"backup policies) and lock that vault in compliance mode. A logically air-gapped vault is locked in compliance mode by default and can be shared through"AWS RAM"so a separate recovery account can restore from it (optionally gated by multi-party approval) even if the owning account is inaccessible. Add a cross-Region copy for Regional disasters. - Close the side doors: Vault Lock governs actions through
"AWS Backup"; denyec2:ModifySnapshotAttribute(sharing) andec2:ModifySnapshotTierwith SCPs (exempting the backup roles), and protect the"KMS"keys the backups use. - Accidental deletion versus attack:
"Recycle Bin"retention rules let you recover deleted"EBS"snapshots and AMIs, and"S3"versioning keeps prior versions; both help with mistakes but are not WORM controls against a privileged attacker. - Test in governance mode first. Compliance mode cannot be reversed after the cooling-off or grace period, and backups with very long retention keep costing money for that whole period. Closing an AWS account still deletes its vaults after the 90-day suspension, which is another reason to keep the locked copy in a different account.
⚠️ Exam Trap: Governance mode, IAM deny policies, MFA on the console and versioning can all be undone by an attacker with enough privilege. When a scenario says backups must survive a compromised administrator or root user, the answer is compliance mode (Object Lock, snapshot lock or Vault Lock) on a copy held in a separate account.