postgresql-backup
postgresql-backup copied to clipboard
Add encryption for backups
Would adding encryption be useful?
I have an internal fork of this repo that also adds encryption. This basically add a ENCRYPTION_KEY var that you point to a key file.
ENCRYPTION_KEY: Use AES encryption to protect the uploaded file.
Cons:
- Needs
openssl
to be installed in Dockerfile
Basically it adds yet another step in the backup process.
def encrypt_backup():
out = backup_file + '.aes'
cmd("openssl aes-256-cbc -md sha512 -pbkdf2 -iter 100000 -salt -in %s -out %s -pass file:%s" % (
backup_file, out, ENCRYPTION_KEY
))
return out