Skip to content

Lesson 8 of 13 · 16m

Ransomware Deletes Your Backups First

Attackers hunt shadow copies and Veeam before encrypting; immutability is the only property that survives credentialed compromise.

Modern ransomware has a defined order of operations, and deleting your backups comes before the encryption. The crews know the recovery calculus: if restore works, nobody pays. So they make sure it doesn't.

The attack sequence

Land, escalate, hunt backups, encrypt. On Windows the hunt is scripted muscle memory: vssadmin delete shadows /all /quiet kills Volume Shadow Copies, wbadmin delete catalog erases the backup catalog, bcdedit /set {default} recoveryenabled no disables boot recovery. On Linux estates the target list is the backup server itself — the leaked Conti affiliate playbook (August 2021) explicitly directs operators to locate and destroy backups before detonating, naming Veeam infrastructure specifically. Backup servers get attacked first because they hold domain-equivalent reachability into every host they protect.

The credential version of this is quieter and total. Code Spaces, June 2014: the attacker got into the AWS console, demanded ransom, and when the company pushed back, deleted everything — instances, volumes, buckets, and every backup and snapshot inside the same account. Not encrypted. Deleted. The company closed permanently. The backups were excellent copies in exactly the blast radius the attacker controlled.

The mental models that fail

  • "Versioning is on." Versioned objects with credentialed s3:DeleteObjectVersion delete just as cleanly as unversioned ones. Versioning protects against accidental overwrite by honest software.
  • "We have snapshots." Snapshots in the same console are deleted with the same click.
  • "Our backups are in the cloud." Same account, same IAM blast radius. The cloud is fine; the trust domain is the problem.
  • "Backups are encrypted, attackers can't read them." Attackers do not need to read your backups. They need them gone. Encryption protects confidentiality; immutability is the property that protects existence.

What immutability actually is

The requirement: a property of the backup that no credential the attacker can plausibly steal can undo.

  • S3 Object Lock, compliance mode. Requires versioning, and since November 20, 2023 it can be turned on for existing buckets too — put-object-lock-configuration or the console — not only at creation. The stale-docs trap inside that change: enabling it on an old bucket applies default retention to new objects only; locking objects already stored takes per-object retention calls or S3 Batch Operations. Until the retention expires, no one deletes the object — not the API caller, not the account root, not AWS support — and a bucket holding locked objects cannot itself be deleted. Governance mode is the weaker twin: s3:BypassGovernanceRetention punches through it, so compliance is the one that counts. PutObjectLegalHold is the independent latch: an indefinite lock with no expiry, removable only by a principal holding s3:PutObjectLegalHold.
  • Append-only repositories. borg serve --append-only behind a forced SSH command: the source host can create archives and literally cannot delete them — the command surface does not include deletion. The same trick works with SFTP chroots and write-only policies.
  • The pull model. The backup server reaches into production and pulls data out. Production credentials never touch the repository at all — there is nothing on the prod host that names or can mutate the backup. Push models put repo credentials on the prod host; root on prod then means delete rights on the repo, unless immutability is in the way.
  • Offline media. Tape and rotated drives have no delete API at all — the physical air gap.

The second half of the requirement is identity separation: the backup lives under a different account root, different MFA, ideally an SCP that denies delete actions to every role in it. If any credential that exists in production can delete the backup, the backup is inside the blast radius.

The practice

Audit the threat as: an attacker holds every secret this host has — what can they delete? Then close the answer: Object Lock compliance on the object copy, borg serve --append-only or a pull model for the repository copy, separate account with separate MFA and a deny-delete SCP. Test it the way an attacker would: grab the least-privileged credential on a prod box and try to delete something. If the API lets you, it would have let them. Immutability is where the "1" in 3-2-1-1-0 stops being a slogan and becomes a mechanism.

Was this lesson helpful?

Sign in to rate

Keep reading

Related articles from the SudoSecurity blog.