borgbackup / borgbackup/borg

using borg with smartcards, crypto sticks, etc.

Open
#4,549 10 comments 1 reaction 0 assignees View on GitHub
documentation keys security
Dominant language
Python
Stars
13.7k
Forks
875
Avg merge
11h 15m
Merged PRs (30d)
192

Description

borg has no special interface / does not use some special api for smartcards or crypto usb sticks.

But there is this:

## environment vars for the passphrase

https://borgbackup.readthedocs.io/en/stable/usage/general.html#environment-variables

- `BORG_PASSPHRASE` - directly give a passphrase to borg

- `BORG_PASSCOMMAND` - execute a shell command which outputs the passphrase

- `BORG_PASSPHRASE_FD` - read the passphrase from an open file descriptor

With these, some tool that might come with your hardware and some shell scripting, you can "glue together" the hardware and borg (no internal change in borg is needed for that).

You can use `repokey` as well as `keyfile` mode of borg for this, the passphrase that would unlock (decrypt) the key would from / via your special hardware, borg's encrypted key would be stored as usual.

## environment vars for the key directory

Alternatively, for usb sticks with encrypted mass storage, the `BORG_KEYS_DIR` (or `BORG_KEY_FILE`) environment variable could be used to let borg read the keyfile directly from the storage on the stick (keyfile mode).

The storage needs to be mounted at some place and `BORG_KEYS_DIR` (or `BORG_KEY_FILE`) needs to point into there (doing that is also scripting and outside the scope of what borg does internally).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.