b2: Add optional secondary key for locks #2887
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This enables a configuration that prevents restic from deleting its own files.
See the explanation in doc/030_preparing_a_new_repo.rst
What does this PR change? What problem does it solve?
This enables a configuration that prevents restic on Backblaze B2 from deleting its own files (either by mistake or as the result of a key compromise). It allows the user to configure two B2 keys: one can read and write but not delete files, and the other can read+write+delete but only under the
locks/
directory.An alternative implementation approach would be to allow two entire backends: one used for most files and the second used only for locks. This would be more general and may enable other useful configurations, but it seems significantly harder for the user to set up.
Was the change discussed in an issue or in the forum before?
I haven't open any discussions before. This is related to and probably conflicts with #2398.
Here's a related discussion for Wasabi, which seems to support finer-grained access policies: https://forum.restic.net/t/append-only-mode-with-s3-wasabi/845. As far as I can tell, Backblaze only allows a coarse list of permissions per key.
Checklist
changelog/unreleased/
that describes the changes for our users (template here)gofmt
on the code in all commits