What's the best practice for taking MySQL dump, encrypting it and then pushing to s3?

Posted by HalogenCreative on Server Fault See other posts from Server Fault or by HalogenCreative
Published on 2010-05-18T19:47:22Z Indexed on 2010/05/18 19:51 UTC
Read the original article Hit count: 162

Filed under:
|
|
|

This current project requires that the DB be dumped, encrypted and pushed to s3. I'm wondering what might be some "best practices" for such a task. As of now I'm using a pretty straight ahead method but would like to have some better ideas where security is concerned. Here is the start of my script:

mysqldump -u root --password="lepass" --all-databases --single-transaction > db.backup.sql
tar -c db.backup.sql | openssl des3 -salt --passphrase foopass > db.backup.tarfile
s3put backup/db.backup.tarfile db.backup.tarfile
# Let's pull it down again and untar it for kicks
s3get surgeryflow-backup/db/db.backup.tarfile db.backup.tarfile
cat db.backup.tarfile | openssl des3 -d -salt --passphrase foopass |tar -xvj

Obviously the problem is that this script everything an attacker would need to raise hell.

Any thoughts, critiques and suggestions for this task will be appreciated.

© Server Fault or respective owner

Related posts about mysqldump

Related posts about amazon-ec2