Ransomware and SQL Server backups: 3-2-1, offline copies and proof
Why backups on the same server are not protection against ransomware, how the 3-2-1 rule applies to SQL Server, and what SQL DATA LOG Backup does and does not do about it.
Ransomware does not only encrypt your database files. It looks for backups too: on the same disk, on mapped drives and on shares the server can reach. A backup the attacker can delete is not a backup.
The 3-2-1 rule
- 3 copies of your data: the live database and two backups.
- 2 different kinds of storage, for example a NAS and cloud storage.
- 1 copy somewhere an infected server cannot change: offline or immutable.
What SQL DATA LOG Backup does for this
- Several destinations per job. One job can write to a NAS and to S3-compatible storage at the same time. If one destination fails, the others still receive the backup and you get an e-mail.
- Encrypted files. Backups are encrypted before they leave the server. A stolen backup is unreadable without your key.
- Retention that keeps history. Daily, weekly and monthly windows keep older copies, so an infection noticed after a few days does not mean every copy is infected.
- No backup files in our cloud. There is no central store for an attacker to find.
What it does not do
What you can add yourself
- A rotated external disk. Add the disk as a local destination and unplug it after the backup window, keeping a disk offline at all times. The destination fails while the disk is away, and the other destinations still work.
- Provider-side immutability. Some S3-compatible providers offer Object Lock or similar. If you enable it, set it up at the provider. We have not tested it together with our retention, which deletes expired files, so expect delete errors until the lock period ends and try it with a test bucket first.
- Separate credentials. Use keys for the backup bucket that cannot reach anything else, and keep the admin credentials of the storage account off the SQL server.
- A key outside the server. Keep the recovery key off the server (see security design).
Proof that you can restore
A copy that cannot be restored is worth nothing, and ransomware recovery is the worst moment to find out. The recommended routine is a regular restore test. Today you do it by hand: open a backup with the Restore page or sqldatalog decrypt, restore it under a new name and look at the data (steps). An automatic weekly restore test with a report is in development and is not in the current build.