by bblb · 3mo ago · 0 comments
Sure it's bothersome to use the sneakernet once a month (manually copy data to USB stick and stash it somewhere), but when that ransomware hits (can happen on personal devices also), it literally can't access the offline copy, and try to encrypt that one also.
Immutable backup solutions are code and thus eventually defeatable from the remote attackers point of view. Offline requires physical access, and maybe a big enough wrench to get the USB stick's disk encryption PIN out of you.
Surrendering just a little bit of absolute control over the physical media can dramatically increase the likelihood that it survives whatever apocalyptic event. I don't know that I've ever heard of tapes being stolen from Iron Mountain. Even if this happened, what are the odds that they would get all the tapes. Your tapes? It probably looks like the warehouse from Raiders of the Lost Ark in there.
For small datasets, a cloud backup (think s3 or azure blob) with credentials that can't be harvested automatically by a malware (eg custom backup script with encrypted credentials - claude will happily write one for you in seconds) is as good as offline. For small datasets (code base, important documents, even photos if you don't go crazy - or perhaps backup a lower resolution as a dooms day last resort thing), this is nearly free.
For larger datasets, you can buy some cheap X11SSH-LN4F or X11SSL-F motherboards on ebay with RAM and CPU for ~$100. These can be remotely switched on and off programmatically with IPMI (same thing, custom scripts with encrypted credentials - claude is your friend). Have your NAS perform an incremental backup once a week or once a month and keep it off the rest of the time (or trigger it from a raspberry pi with own credentials if you don't want to connect IPMI to your LAN or have encrypted IPMI credentials on your NAS). And unless a malware hits right at the time of the backup, it is as good as an offline backup while also being automated. Doesn't protect from a power surge though, which may or may not be a problem depending on where you live.
Also have your backup pull data from your NAS rather than the other way round, and run with different credentials than your NAS, so a malware can't jump from the NAS to the backup (or encrypt the backup). I have seen first hand that if you reuse admin credentials between machines, one machine compromised means all machines compromised within minutes.
Well overdue for a refresh.
I also have a set I curate and put in with the family & household papers. That doesn't have any of my personal crap, just documents, photos, and family history etc.
I have two of these and rotate them weekly and keep one at my work (and I have a self-hosted healthchecks.io instance to remind me if I forget).
An extra protection against the possibility of malicious access such as ransom attacks is a two-step “soft-offline” backup.
The source machines backup to a central place, and the backup machines pull copies from there. The important part is that the source machines can not connect (or at least can not authenticate against) the final backups and vice-versa, so a malicious process/person getting into one can not affect the other and vice versa. Obviously if I don't notice the damage immediately then the most recent backups may be corrupted because damaged data was pulled, but past snapshots (taken after each pull at the backup side) will still be clean.
You have to be very careful about storing credentials to make sure source credentials don't ever end up on the backup machines and backup credentials don't ever end up on the source machines, even well out of the way of normal places like ~/.ssh, because a targetted attack might find them, but it gives almost the assurance of an offline backup while still being fully automatable. My backup site credentials are in my true offline backups, I need to refer to them for maintenance access, and then they get cycled after that use.
Restores can be mediated the same way. Verifying backups can be done by both sides running hashes on the files and posting the list back to the central machine for comparison - anything that differs without having a timestamp after the previous snapshot is likely corruption.
As a side note about corruption: if doing snapshots in the filesystem (“cp -al after rsync” or one of the many similar options) make sure you have more than one snapshot chains (on separate storage if you have resource for that). If you have a file that hasn't changed in years so every one of your snapshots points to that one version, it could only take one random filesystem error to completely lose the file.
Yeah, but an attacker is unlikely to compromise both you and your storage provider at the same point. Many S3-compatible storage providers (e.g. Backblaze and Hetzner) support object lock, where you can lock objects for a certain number of days (and refresh locks if the objects are still used in recent backups). Typically object locks are implemented such that not even you yourself can remove the data from the account settings.
E.g. when I cancelled my Backblaze B2 account, I had to wait until the object locks expired before I could remove the remaining data and delete the account.
Arq on macOS has great support for object locks BTW.
At the end of the day it depends on what is your threat model. Mine is 1) automated malwares and 2) my own fuckups. I am not trying to prevent the NSA from hacking me. Against an automated malware, custom scripts with encrypted credentials that don't show in clear in command lines or environment variables are probably good enough.