r/Backup • • Sep 30 '21

Borg – quality of encryption?

Hi!

I am considering paying for a remote backup solution with rsync.net. I love the backup software Borg (I already use it for local backups) and rsync.net supports remote backups with Borg. It's wonderful, sounds like just what I need.

I am only wondering one thing: given that Borg is still in development, is its native encryption trustworthy? The thought of uploading sensitive data to a remote machine makes my hair stand on end.

I have considered an additional layer of encryption using Cryptomator. Do you think it would work and would this solution have any disadvantages? How do you encrypt your own remote backups if you only want to rely on open-source software?

Thanks!

1 Upvotes

25 comments sorted by

2

u/ssps Sep 30 '21 edited Sep 30 '21

Why rsync.net out it all other providers? Why not B2 or S3 or Wasabi?

Borg is time proven piece of software, it’s encryption is no better or worse then any other.

You can use rclone serve as an adapter between borg and the storage backend.

If you are happy with borg — no reson not to continue using it.

Cryptomator will only add complexity and another (VFS) layer that can fail and/or introduce caching making backup no deterministic. If you really want to add additional encryption — you can use rclone crypt remote (up to 2048 bits, IIRC)

So your setup will look like so:

  1. Raw storage on AWS or Wasabi or B2

  2. Corresponding Rclone remote configured to access 1.

  3. Rclone crypt remote on top of 2.

  4. rclone serve sftp of 3 with caching disabled.

  5. Borg backing up to sftp server 4.

Edit: footnote: If starting from scratch today however Borg would not be my first choice; I would have probably gone with a backup solution that supports multiple endpoints natively and has other modern features (assymetric encryption, content aware chunking, etc); most likely that would be Kopia, which has recently reached RC status, or Duplicacy if more established and stable software is desired (I’m using the latter for years successfully, answering your other question). Kopia is opensource and duplicacy while not strictly open-source (it’s a commercial software) the source is hosted on GitHub and you can build it yourself. (It’s free for personal use though).

Edit2. What do you mean “borg is still in development”? Version 1.1 is stable.

1

u/chaplin2 Oct 02 '21 edited Oct 02 '21

On encryption:

  1. Don’t recommend asymmetric encryption for encryption at rest. It’s convenient, but I doubt it will protect your data beyond 2030. Use symmetric encryption.

  2. Borg’ encryption has some limitations. Thete is no confidentiality if multiple users back up to the same repository. Also it uses (older version of) libressl. Depends if you trust OpenSSL and libressl more than Go libraries coming from Google.

  3. It’s not true that you mostly don’t need to download your back up fully (it’s an action done once all other recovery options fail). Encryption will require to download the full repository periodically for integrity verification. Backend is therefore important, particularly with regard to egress fees.

  4. With encryption, privacy still is important. You need to take additional measures. Encryption sometimes has vulnerabilities. I can give you examples that might surprise you!

  5. I wouldn’t rush to use latest back up software, until there is fair amount of confidence in its encryption. Kopia is merely at the level of promising now.

1

u/crow445 Oct 02 '21

Why? (as to point 1)

And the Go libraries are open-source, aren't they? So it shouldn't be a problem... (point 2)

1

u/chaplin2 Oct 02 '21

For 1, to cut a long story short, quantum computers with increasing capacity are being built.

For 2, yes, I trust Go implementation of crypto better than OpenSSL.

1

u/ssps Oct 03 '21

Interesting.

On the first point:

For 1, to cut a long story short, quantum computers with increasing capacity are being built.

Why would symmetric be any better than asymmetric? And assymetric allows for useful user scenarios (everyone can backup, but only admin restore) amount not having the restore key on the user's systems prone to swiping.

2. I can't comment on Borg. OpenSSL had crazy bugs in the past too. No software is impervious. I do however trust that people who work on it know what they are doing and do their best. That's the best assurances we have. Same libraries are used across industries, so if say TLS is broken tomorrow your backup being compromised would be the least of your worries. So we just assume that we can trust modern encryption. If not -- we should not be connecting to the internet and keeping files handwritten on papyrus in the mattress in the concrete bunker on the bottom of the Pacific Ocean.

3. I disagree. Your backup software should be able to download metadata only to confirm that all data needed to reconstruct your files is in place. There is no need to download files to verify their integrity -- this is a job of your storage provider to guarantee consistency. You have to trust that. If you don't -- change provider. Otherwise where are you going to draw a line? Do you trust TCPIP? your HDD (hint -- you probably should not)? RAM? CPU correctness?

4. I guess nothing will surprise me at this point. There is no absolute security. It is always a tradeoff. EU privacy policies are not a deterrent for malicious actors. Physical security in the datacenter -- I doubt google has it worse, and nobody will be breaking into anyones datacenter on a bulldozer to get my data. Maybe there is tiny improvement in some areas and disadvantage in others -- which definitely is not worth doubling cost of storage.

5. Yes. It has reached Release Candidate just recently. It's worth watching, but I don't see myself jumping to it anytime soon either. It still lacks some quality of life features (like xattr exclusions). I still managed to somehow corrupt its data store twice while playing with it -- I'm sure I did something wrong, but it should not have allowed me to do those things. (it was on two versions back, before the redesign of datastore). Maybe I'll start using it as a second solution along side of my current one to build confidence.

1

u/chaplin2 Oct 03 '21 edited Oct 03 '21
  1. Symmetric and asymmetric encryption algorithms are totally different. For asymmetric encryption, quantum algorithms already exist. Symmetric algorithms with 256 bits keys are believed to be resistant against quantum attacks.

Governments save data to be decrypted later. Use a symmetric cipher for backups. Asymmetric encryption was designed for a different use case. Use the right algorithm for the job.

2. To be fair, TLS vulnerabilities are mostly outside libressl library used by Borg. They have to do with negotiation and issues in handshake phase, etc, not relevant to encryption at rest.

I wouldn’t worry about Borg encryption, so long as multiple parties don’t back up to the same repository. However, I view Go crypto library to be of higher quality than libressl.

3. Bit flips occur on host, before reaching remote. Obviously, chances of a bit flip on a storage like S3 is almost zero. Errors are automatically fixed by provider. Which is why I like cloud!

4. —

5. I will keep an eye on it. It’s same as Restic with few changes. The improvements (GUI, compression) are not compelling enough to switch. Restic is the best software I tried, which might add compression in 1.0.

Overall, Borg, Restic and Duplicacy are apparently winners in this space. If you talk to sysadmins, they tell you Veeama. That’s for VMs and full system images.

1

u/crow445 Oct 01 '21 edited Oct 01 '21

Thanks a lot, ssps! Your post has opened my eyes to the many possibilities. I've been playing with Kopia a bit and I like it so far. I think it could replace Borg for off-site backups. I like that it integrates natively with the cheaper cloud storage providers such as B2. Do you think that Kopia's encryption can be trusted? Or would you implement a 2nd layer of encryption, for example using rclone?

1

u/ssps Oct 02 '21

I would trust kopia's. Both kopia and rclone are written in the same language (go) and likely are using same encryption libraries (I did not look into it deep enough, but it's easy to verify). IIRC Kopia allows to pick encryption cipher and even can run benchmark to measure performance of each on your hardware.

My only gripe with Kopia is that is does not support excluding files by attribute (such as com.apple.metadata:com_apple_backup_excludeItem on macOS). Pretty much every other backup tool there is does -- Arq, Duplicacy,.. even CrashPlan. Actually, Duplicacy did not either, but users (including myself) asked for it and it got added. This is a very important feature on a macOS where it is common practice and expectation for applications to mark transient files with that attribute to avoid Time Machine backing them up. This relieves the user from writing manual exclusion rules effective re-doing the work all app developers have already done.

On Windows and Linux it is probably not a big deal as there is no such well established mechanism on that OS.

Hierarchical configuration profiles are great, and the fact that it stops backup configuration at the target is a nice bonus.

Another killer feature (which won't surprise you, Borg has it too, but duplicacy does not, and I really want it) is ability to mount backup history as virtual drive, just like Time Machine does. It's awesome :)

1

u/crow445 Oct 02 '21

I also like Kopia, thanks for telling me about it. :-)

However, I am having issues with file exclusion as well. The documentation about it is really bad, no examples whatsoever, it's just saying that "excluded files can be defined similar to .gitignore" I've tried multiple variations for hours and to no avail. Do you maybe have an idea?

Actually, I would prefer if Kopia supported (or does it?) the Borg way - you can write a file containing a list of files/directories you want to exclude from the backup, each on one line, and then do borg create --exclude-from "/path/to/the/exclude/file" ...

Since I haven't discovered that function in Kopia, I tried to add those directories manually by following the .gitignore syntax and doing: kopia policy set --add-ignore=/home/user/ignorethisdir/** --add-ignore=/home/user/downloads/thisdiraswell/** /home/user

However, the excluded directories get backed up as well. What am I doing wrong? It's slowly driving me bonkers...

1

u/crow445 Oct 02 '21

Oh, I worked it out. Kopia will read the .kopiaignore file in the top directory which is backed up. The file has this simple syntax (all relative paths!):

path/to/a/file
path/to/a/directory

It's a real shame that one has to mess up the home directory with this .kopiaignore file. I would much more prefer if the list of ignored directories were saved somewhere in .config/kopia/...

But that's just one detail, Kopia is great otherwise...

1

u/ssps Oct 02 '21

Actually, I prefer that, keeping exclusions next to the data. (Duplicacy supports similar option, but less granular -- you can put a special file to folders you don't want' backed up. It does not need that though -- because it supports xattr-driven selection). This is one step removed from the ultimate solution of using extended attributes to indicate which files and folders to skip -- this is how Time Machine handles exclusions on MacOS.

And using .gitignore syntax is a great choice too:

  • Most people already familiar with git -- so no new syntax to learn

  • its much less complicated and more readable than regex and yet more flexible than glob.

  • Keeping the exclusion file with the data means that you can also back it up easily and it is guaranteed to survive software reinstallation and what not.

It's a real shame that one has to mess up the home directory with this .kopiaignore file.

Home directory already has a bunch of config files. Wrapping them in another folder (config) hardly adds any value. Truth be told, presence of .config folder in my home folder annoys me, its' one more word to type to reach the files inside; but I'm sure there is some weird historical reason for it.

I would much more prefer if the list of ignored directories were saved somewhere in .config/kopia/...

The idea is to keep metadata (whether specific file needs to be excluded is metadata about this file, not property of backup software) close to the data. As a side benefit this allows hierarchical exclusion where you can have multiple such files in the folder hierarchy (not sure if Kopia supports that)

IN all fairness, its' very new and there are a lot of scenarios that need fixing or polishing. For example, multi-user setup, interaction with launchd and user desktops, global password for UI, etc. I'm still watching it, once they add support for xattr to indicate exclusions -- my litmus test of backup software maturity -- that's when I'll consider it ready :)

1

u/crow445 Oct 02 '21

Doesn't it bother you that you can only specify the relative path of your ignored directories/files in Kopia? That means if you blacklist directory abc, then the directory /this/is/a/long/tree/abc gets ignored as well. Which is scary for a backup system. I already created a post on Kopia's forum about that, but would be curious to know what you think.

Home directory already has a bunch of config files. Wrapping them in another folder (config) hardly adds any value. Truth be told, presence of .config folder in my home folder annoys me, its' one more word to type to reach the files inside; but I'm sure there is some weird historical reason for it.

This is the "weird reason" for not messing up $HOME. Call me fussy if you want, but already the 11 files/dirs in my $HOME drive me crazy (it's basically just the ones that don't respect the XDG Base Directory Specification). I like my order.

1

u/ssps Oct 02 '21

Doesn't it bother you that you can only specify the relative path of your ignored directories/files in Kopia?

Honestly, I haven't looked into it; but if they fully adopted gitgnore syntax, then you should be able to specify absolute paths, albeit from the root of the repository, as opposed to root of the volume. Does it not work? If not - then that's the kind of polish that needs to happen :)

This is the "weird reason" for not messing up $HOME. C

This is just one of the ways to organize things on some OSes, that chose to adopt that way for the lack of a better one. Others -- have their own conventions. For example, macOS (which is derived from Darwin, derived from mach, nextOS and rooted in BSD) has its' own convention: config goes to [~]/Library/Preferences, caches -- to Library/Caches, support files to Library/Appliation Support, etc. Having another config folder in user's home is redundant - ~/Library is superset of the purposes that folder exists.

And then if you think about it abstracting from "files" and "folders" (which is pretty arbitrary classification anyway) -- those config files in the root of home already live in the separate namespace: you don't normally see them, and if you type ~/.<tab> -- you will only see them. That's their separate namespace -- being dot-file. And if you look -- most of useful day to day apps do just that: vim, bash, zsh, git, iterm2, ssh, viscode. (And then comes rclone and puts its file into ~/.config/rclone/. There is no good reason for that, and it violates KISS).

I like my order.

Ultimately, that's the reason. Does not matter what arrangement there is, as long there is one and is consistent. It still pisses me off that Duplicacy puts cache into ~/.duplicacy/caches and logs to ~/.duplicacy/logs. It's not hard to check for OS type and write a little switch statement. It's all that polish. (for duplicacy I manually create folders in the right places and then symlink them to ~/.duplciacy/... yep, that's annoying, but apps need to be a good OS citizens). BTW -- I've tried Arq again -- these folks do (almost) everything right. It's absolutely fantastic UI wise. have a look. But it has benefit of existing for a long time and the author has the right mindset about developing good software :)

1

u/ssps Oct 02 '21

Actually, it does support both:

https://i.imgur.com/YHStjpD.png

You can specify exclusions globally (which are stored in the configuration file at the storage) and use .kopiaignore in any directory to adjust/override global exclusions. Or none. Or both.

3

u/PitBullCH Oct 02 '21

This point about mounting the backup as a filesystem should not be ignored - it’s a colossal advantage when trying to restore other than an entire backup. Used it a few time recently and it’s “wow” every time.

1

u/IIPoliII Oct 01 '21

If you wish an alternative with truly no limits you could using Poli Systems S3. https://polisystems.ch/en/s3

There is no egress fees at all not like wasabi and the data is located in Switzerland synced in two different datacenters. Drives are encrypted on the hardware level.

1

u/ssps Oct 01 '21 edited Oct 01 '21

https://polisystems.ch/en/s3

Interesting. It's more expensive though -- more per TB, and you have to pay in increments; if you have 1.0001TB to store you'll have to pay double, and benefits are unclear.

There is no egress fees at all not like wasabi

Wasabi has no egress fees, and with Backblaze B2 you can egress for free to Cloudflare via bandwidth alliance. Duplicacy btw fully supports this usecase by allowing to provide alternative download URL.

Having said that -- egress cost for backup is pretty irrelevant in the grand scheme of things.

the data is located in Switzerland

This will likely translate to poor performance for NA users.

Drives are encrypted on the hardware level

This is irrelevant and implementation detail. Data should be encrypted on the client; what is required from the storage provider is redundancy and uptime. Which, in case of polysystems "99.5% uptime guarantee"-- is pretty crappy.

I fail to see benefits -- it's more expensive and worse even on paper.

2

u/IIPoliII Oct 01 '21 edited Oct 01 '21

With Wasabi you can only download as much as you store imagine retrieving a backup when you already downloaded it once. You need to pay the double. You also pay 90 days for your objects. Here as you pay a fixed size there is no random pricing. It means that if you hit 1 TB that's it you can get more space if needed, but you won't have a surprise at the end of the month.

Yes but the bandwidth alliance is yet still not deployed from what I heard? I am not sure on this point maybe it's already the case.

Sure it depends on your peering if you are peered with Tier 1 datacenters you will get even more than 1Gb/s. We are talking about an EU provider not a NA/AU.

99.5% is network minimum network uptime not the storage policy. The network uptime was 100% last year. I must say that we need to update this through.

Please compare wasabi starting at 10 TB, and at 500 you cannot compare with Wasabi. It's also different, we are located in Switzerland which is a way more expensive, in terms of general costs.

The data privacy is more strict in Switzerland than the GDPR which is surely an advantage.

It's interesting depending on your usage, if you are a user of Synology for example it's not that rare that you need to retrieve data for it. Or even full data of it, and if you need to rebuy some hardware you don't need to be billed even more to retrieve your backups.

We may have a few less advantages because of our size compared to AWS, B2 or Wasabi, but I am quite sure our truly unlimited usage has it advantages. On quite a few things we beat some providers on the paper without depending on another company for the bandwidth. We also have the advantage that we always improve for example your comment really helps us to improve such products!

1

u/ssps Oct 01 '21

Thank you for interesting discussion btw.

With Wasabi you can only download as much as you store

Oh, absolutely. They have many more "interesting" cost structure "features" -- like minimum 90 days retention -- all of which are designed have the user pay more, affecting some more that the others.

imagine retrieving a backup when you already downloaded it once

Backup is something you don't expect to download ideally ever. You might end up restoring a couple of files here and there -- but catastrophic system failure where the full download is needed is (should be!) a very rare event. And in this case -- sure, you'll have to pay either way. But optimizing your workflow for the unlikely event you need to do a full restore twice in a row may not be the best approach.

To be clear, I'm not defending Wasabi, I don't recommend using it as it going to turn out to be more costly than expected for most users, and their uptime was not great historically; I only mentioned it since many use it, and I did put at the end of the list :)

There will be, however, some users with very specific requirements for whom B2 will work best, or Wasabi, or rsync.net, or your company's services -- but those users should be picking solutions with their specific needs in mind.

After all, unlimited google drive at a fixed cost of $20/month is unbeatable if all you care about is the cost per TB and free egress and okay-ish performance. Reliability and uptime will be phenomenal BTW. And yet, it may not be suitable for folks who have huge (over 750GB/day) data turnover or require low latency access (those folks may need to implement local caching -- but that's for another discussion).

Here as you pay a fixed size there is no random pricing. It means that if you hit 1 TB that's it you can get more space if needed, but you won't have a surprise at the end of the month.

It will be slightly more expensive because all users will be paying for the remainder of the whole Tb they don't use. Synology does the same with their C2 storage tiers. It's annoying, as almost no one has a whole number of TB, so these companies always overcharge. I understand it's the whole point of this cost structure, and it benefits the company, but as I customer -- I refuse to use those companies on principle: invariably, there are other gotchas to be discovered.

The data privacy is more strict in Switzerland than the GDPR which is surely an advantage.

Can you please elaborate on how is it relevant for the present discussion? Backup data is encrypted as it leaves the client. Storage providers can publish it on Pastebin in plaintext for all I care. As long as they don't lose and corrupt it -- privacy and access are irrelevant.

Or even full data of it, and if you need to rebuy some hardware you don't need to be billed even more to retrieve your backups.

Using a backup service for system migration is not the intended purpose; it's much cheaper and faster to do local transfer thus avoiding paying for traffic and saving time.

We may have a few less advantages because of our size compared to AWS, B2 or Wasabi, but I am quite sure our truly unlimited usage has it advantages.

Absolutely. I don't doubt that it would be the right solution for some use cases for some users. As will be rsync.net mentioned by OP, and many other small and large providers.

All I'm saying is for the present discussion -- selecting cloud storage for backup -- I don't see any advantages your company offers compared to many conventional alternatives.

And lastly,

our truly unlimited usage has it advantages.

This may be concerning. There is no such thing as "truly unlimited" that can be sustainable for a fixed price, and if users start downloading their datasets daily or using the service as scratch storage over gigabit links I'm sure you'll have to do something about it -- like begin charging for API calls or egress, or have to discontinue the service. This has already happened with many other providers, large and small.

I don't have a problem with "unlimited" storage that monsters like Google offer -- because they have a lot of other revenue streams and not only their e.g. GoogleDrive offering is incidental to other functionality but also huge customer base makes it possible to absorb abuse from a few that take the word "unlimited" literally. But if you are a smaller company and storage is your main product, and you have "unlimited" mentioned anywhere -- I'd be very suspicious and will be reading ToS with a magnifying glass and still not trust the service in general, not in the long term. Just my 0.002. I do wish your company prosper and grow -- but pretty much every single company that had "unlimited" in the name either disappeared, or quality of service went to crap, or terms of service have changed. Just my two cents.

1

u/chaplin2 Oct 02 '21 edited Oct 02 '21

Quick question.

One of the important features of a back up software with deduplication and encryption is reliability (stability and robustness).

You want the software to be resilient against errors, for instance, network interruption, integrity errors linked to the software, etc.

I don’t care if software is fastest or has the latest fanciest features. I care more that repositories are not fragile.

In this respect, which back up software is better?

Examples: Borg, restic, duplicacy, duplicity, kopia, veeama, etc.

2

u/ssps Oct 03 '21

Quick question.

Huh :) this is anything but :)

One of the important features of a back up software with deduplication and encryption is reliability (stability and robustness). You want the software to be resilient against errors, for instance, network interruption, integrity errors linked to the software, etc.

Absolutely agree. I have expressed the same thought, almost verbatim, here: https://forum.duplicacy.com/t/comparison-duplicacy-borg-restic-arq-duplicati/4210/4

In this respect, which back up software is better? Examples: Borg, restic, duplicacy, duplicity, kopia, veeama, etc.

It's a very hard question to answer without extensive testing. Which I went through few years ago when selecting backup tool. I did not stress test all available tools, only those which passed my other requirements. I did not test Borg, and Kopia did not exist, but out of the rest (including Arq) Duplicacy turned out to be most resilient to datastore corruption: it has simple design, and easy to understand dependencies, and due to its architecture underlying datastore corruption has limited scope of damage (but that is really irrelevant because storage backend you are using is supposed to guarantee data integrity) and robust towards network interruptions by means of transactional nature of updates and reliance on filesystem services and no locking central database: if there is no database it can't get corrupted :)

So in my opinion duplicacy, in spite of some UX shortcomings is still the best for me in terms of letting me sleep well at night. It also just happens to be ridiculously performance, which lets me throttle it down heavily so I don't even feel when it's running. So win-win.

Few comments on other tools you mentioned:

  • duplicity (and qBackup for that matter) creates a long chain of incremental backups. The longer it goes the more fragile it gets. The design is outdated.

  • duplicati (if perhaps that's what you meant -- autocorrects and all, and lack of imagination of people naming software) can't be taken seriously - there is no stable version and upon testing it is not only slow but also heavily bug ridden. I've tested on macOS so perhaps Mono is partially to blame, but why should I care?

0

u/AndyIbanez Oct 03 '21

This is a fantastic answer. I have been looking into using Borg because what I read about it really gets my attention, but I have had no way to use it because I cannot find a cheap place where I can find a machine with SSH enabled and good storage space.

Can I expect any downsides with this approach? What happens if my internet cuts off in the middle of an answer? I'd use Borg with a B2 backend.

I was looking into HashBackup (which sounds really similar to Borg, except for cloud storage), but the fact it's not open source is a big point against it.

1

u/PitBullCH Oct 02 '21

FYI Rsync.net are fabulous, but quite expensive - I use them myself. You can as an alternative use BorgBase and Lima Labs - both work same way and work fine.

0

u/sprayfoamparty Oct 05 '21

Not able to find a linky source but I have heard Cory Doctorow say words to the effect of: the standard encryption you get on your phone (if you turn it on) is so good that if you turned every hydrogen atom in the whole universe into a super computer, and they did nothing but try to break the encryption on your phone until the heat death of the universe, the end of time would be reached before your phone would be compromised.

Then he goes on to talk about Rubber-hose cryptanalysis and the fact that there is no such thing as crypto that can solve coercion. And there are other human factors that have to be addressed collectively.

Anyway he's a smart cookie and I've never heard anything to contradict the above. My understanding is that really strong crypto is available to (and from) the open source community and problems arise when people either decide to roll their own or there are vulnerabilities elsewhere.