mysql - Securing backup credentials for MySQLDump -


i want use mysqldump backup db on weekly basis using cron job. don't want hardcode credentials in shell script. mysql db version 5.1, mysql-config-editor not available. aware of options file, can secure using linux file permissions of 600. there way encrypt credentials , make them unreadable?

is there way encrypt credentials , make them unreadable?

ask want protect file , why encryption going besides normal file permissions.

if going encrypt file containing password, have make sure legitimate backup process has access encryption keys can read password file. have make sure other processes don't have access keys.

since further complicates things, increases risk on leak without adding security on top of basic file system security model. recommend stick right ownership , file permissions on .my.cnf file.

further reading: http://benlog.com/articles/2012/04/30/encryption-is-not-gravy/

i run mysqldump daily root via cron. in order break attacker needs break basic file system privileges before can access /root/.my.cnf (mode 600 , owned root). if attacker able that, can directly access database files encrypted password file wouldn't have helped here.

you can setup dedicated system user sole purpose of running mysqldump long mode on ~/.my.cnf 600 , ownership set system user.

ps. mysql backup script run daily on machines: https://gist.github.com/timkuijsten/6067107


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -