Send the "encryption_passphrase" option to Borg via an anonymous pipe. #998
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "passphrase-via-file-descriptor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR sends the
encryption_passphrase
option to Borg via an anonymous pipe (using theBORG_PASSPHRASE_FD
environment variable to refer to that pipe) instead of the previous behavior of sending the passphrase via environment variable. The motivation is that environment variables can potentially by spied upon, for instance potentially by child processes of borgmatic/Borg or anything that compromises a machine and has access to/proc/[pid]/environ
. And especially now that borgmatic has the ability to read credentials from various sources into thatencryption_passphrase
option, it seems prudent to not allow that value to get subsequently compromised via environment variable.So this anonymous pipe change applies to:
encryption_passphrase
valuesencryption_passphrase
that references an environment variableencryption_passphrase
that loads a credential via{credential ...}
encryption_passcommand
commandIt does not apply to:
BORG_PASSPHRASE
when passed in externally andencryption_passphrase
is unconfigured. In that case, theBORG_PASSPHRASE
environment variable gets passed through to Borg untouched.However, note that like with previous versions of borgmatic,
encryption_passphrase
, if set, still takes precedence overBORG_PASSPHRASE
.Still to do
borg/environment.py
Released in borgmatic 1.9.11!