4 ms·
Glad you asked. First, Snebu goes back about 8 years, although the encryption code was developed more recently. That also explains thy it the hash is sha1 (at
by derekp7 6y ago
Glad you asked. First, Snebu goes back about 8 years, although the encryption code was developed more recently. That also explains thy it the hash is sha1 (at the time the thinking was "it is good enough for Git"). Right now it is kept for unencrypted backups for backward compatibility with previous versions. But it is something I would like to address -- possibly by using sha-256 (or truncated sha256) or make it user selectable on new repositories. This will be on the next version, didn't want to make too many changes at once. However encrypted backups do use a sha256 HMAC.
Compared to Borg and Restic, by making the system server-based, it does limit things like being able to add direc-to-cloud backup, but a future capability may be added to efficiently replicate a Snebu server backup to cloud. However what it gains is better manageability, especially if you are backing up a number of hosts to one repository. In my instance I'm backing up about 50 hosts with 14 daily, 6 weekly, and 12 monthly snapshots.
Compared to Restic and Borg, it uses public key encryption (so you don't need to leave a sensitive symmetric key on your clients), but with HMAC-256 based hashes. So an attacker would need both your public key and the HMAC secret (only a one-way hash of the secret is stored on the server). The client reconstructs the HMAC key using the public key and the passphrase for the private key. Oh, and you can use multiple keys -- a client specific key, and a backup key (or more). Deduplication will work across all clients that share the same set of keys (the HMAC of all keys is used for the file storage hash). But for this attack scenario (forged data), you will need to keep the client key file safe and stored with appropriate permissions, and you can use a different key (and lose cross-client deduplication) across clients that are in different trust zones.
As for the SQLite DB size -- on one of my installs the DB is taking 50 GB, and is storing over 1500 backup snapshots, from 73 hosts (CensOS and RHEL some with Oracle DBs), with a total of 4.5 TB of disk storage used.
The SQLite DB is critical as it stores which file belongs to which directory path on which host -- so it should be backed up independently (at the end of the backup script I use sqlite3 commands to do a dump of it once a week and run a vacuum command). Todo: add these maintenance commands to the Snebu binary to limit the need to run the Sqlite3 CLI.
Other features unique to Snebu -- you can have the server "pull" backups without installing an agent on the clients (the "tarcrypt" will still need to be on the client if encryption is needed). You can have the clients "push" data to the server using a restricted user account that allows backups but not deletes or restores, and have a separate restore ID for example. You can give different administrators IDs on the the backup server access to different groups of hosts in a look-but-don't-touch, etc.
Another item I like -- let's say you tell it to expire all monthly backups older than 6 weeks. But then if the host hasn't successfully backed up in more than that time (say it has been taken offline), there is a default to keep the most recent 3 backups in a retention schedule, so you won't accidentally lose all you backups in this case (the "preserve" number can be adjusted via command line parameters).
- lucb1e 6y ago> possibly by using sha-256 (or truncated sha256) or make it user selectable on new repositories Honestly I have not found that user-selectability of algorithms has made anything better. It might be convenient for the developer or a maintainer to somehow be able to change it without recompiling the whole thing, but I wouldn't include security parameters in regular config files that users change. In the 90s this made sense with encryption considered equivalent to ammunition (it still is, but laws have been relaxed) and needing to be changed on the fly, not-so-battle-tested algorithms that you want to quickly switch between, updates coming on CDs, etc. These days, we have security updates coming automatically and we know that some algorithms are pretty much rock solid for the foreseeable future. If one person reads up on it properly and then sets good values, a user (even if that user is a knowledgeable sysadmin) should really not have to tweak it. SHA2 sounds like a good choice, I would just stick with that. Do think about upgrade paths, but assume that you (or a future maintainer) will just provide an update when (if) SHA2 starts to be weakened in similar ways to SHA1. > a number of hosts to one repository Oh that sounds cool, especially with deduplication between them. Restic would be able to do that as well, but they couldn't run concurrently at all and it doesn't really seem to be meant for that sort of thing even if it does store the hostname with each backup ("snapshot"). This would certainly be an interesting feature to a lot of people, I had never even considered using the same repo for multiple systems! > [the sqlite database] should be backed up independently (at the end of the backup script I use sqlite3 commands to do a dump of it once a week [...] Oh, that is a very important gotcha. I would expect that when I made a backup, it contains whatever is needed for it to be restored. Glancing through the results when searching the page for 'database', it doesn't seem to be mentioned. Am I overlooking the backup script you mentioned, or is that just your own backup script and not on the page? > Other features unique to Snebu -- you can have the server "pull" backups without installing an agent on the clients (the "tarcrypt" will still need to be on the client if encryption is needed). You can have the clients "push" data to the server using a restricted user account that allows backups but not deletes or restores, and have a separate restore ID for example. You can give different administrators IDs on the the backup server access to different groups of hosts in a look-but-don't-touch, etc. Ooh that is really fancy! Especially the second one; how is that enforced, I assume with filesystem permissions? Something like allowing to create files but not change existing ones (chmod +w on the directory and chmod -rwx on the files iirc)?