Feature: Disable GPG key backups
Brought to you by:
edso
Currently, duply automatically backups GPG keys to the profile directories. I would like an option to disable that behaviour.
The reason I do not want these backups is:
/etc/duply to my other machine, but now I have to carefully exclude the keys to prevent them from leaving the backed-up machine./etc/duply.Thinking about this, I guess it would only be needed to disable backup of the private key, the public key is not sensitive and would actually be convenient to sync to my other machines.
Would something like a GPG_DISABLE_PRIVATE_KEY_BACKUP option (maybe something shorter?) make sense?
As a workaround, I've now made the private key backup files empty. This prevents new backups from being made, without leaking the keys. This is somewhat fragile, though, since if I make a new profile and forget to empty the files, I'll be leaking the key anyway...
while it's easily implementable by yet another config var i am a bit hesitant (again sorry;9).
reason is, that your profile is meant to be the private data/config to restore your data e.g. on a new machine. it is supposed to contain all the "secrets" needed (backend credentials, keys) so that the user does not have to worry about them.
encrypting against a second (like your personal) public key is suggested anyway, even if only to recover your backup in case the machine key is lost/corrupted somehow.
generally your duply profiles need to be secured locally anyway (file permissions etc.) so only the user doing the backups can read them. so if you copy it over to another machine it is your job to do it in a secure manner. if youdon't want the private keys to leave the local machine simply don't copy them ;) e.g. via
rsync --exclude="**/*.sec.gpg"as a workaround, if you are insistant you may of course hack it ;). you should be able to add the keys in question to
DUPL_PARAMSconf var as described in the duplicity man page and duply should ignore them. not sure if the gpg test will succeed then though!..ede/duply.net
Hm, I settled for the workaround of excluding the files in a sync (I'm not too happy about it, since it's still to easy to accidentally leak the keys), but ran into the same problem in a different way.
I'm making backups of my server and just synced the duply configs to my local laptop. Backups are encrypted to one private key that lives on my server and my personal private key that lives on my laptop.
Now, when I run any duply command (I think, I tried
status), it will try to export my personal private key. Of course it has a passphrase, so I get a prompt that I can cancel, but that seems to fail the backup. Even if it wouldn't, I really do not want my personal private key end up on any disk without a passphrase, so I would rather have duply not try this at all.Implementing a
GPG_DISABLE_PRIVATE_KEY_BACKUPwould fix both problems for me. Since you would typically sync the config between backup and restore host, this would disable key backups for both and I can imagine that others might want to backup their backup key but not their personal key, which would need something like selecting specific keys to be excluded (or included) in the backup. Or, you could imagine that anyone that encrypts to multiple keys is going to do their own private key management anyway and does not backups at al (so a blanketGPG_DISABLE_PRIVATE_KEY_BACKUPwould be fine).yeah, the dual secret key approach was not within the scope of the initial duply development. to implement a black-/whitelist for keys safe to im-/export seems possible, but too elaborate just for this "feature".
right now i feel like optional GPG_IMPORT/EXPORT="disable" for cases like yours are the easiest way to go.
will give it a go, when i find the time.. ede
Last edit: ede 2020-09-06
added/implemented settings
will be in next release duply v2.3 ..ede
Took a while for me to test this, but I just did and it works perfectly. Thanks!
good to hear!.. sunny regards ede