in reply to Storing credentials in a cross-platform binary file?
my $DBH = DBI->connect('dbi:mysql:host=server.example.com', 'dba', 'my +dbapassword');
The idea is you store the credentials in an external file that never hits version control (many people don't think about passwords sitting there). The passwords in the external file are encrypted, so that should the file fall into the wrong hands (misconfigured web server, file symlinked into FTP root, etc) the passwords aren't easily obtainable. Likewise, if someone gains access to your source code repository they shouldn't be able to gain DB/LDAP/web service passwords from the code. Lastly, with passwords in a separate file you can be more pedantic about file-system ACLs to control access to the file, in addition to the other safeguards in place. So, ultimately it's a good requirement, I'm just surprised there's no existing CPAN module to implement it.
Thanks to all for your help! I think I will go down the road of serializing the credentials and encrypting the resulting file. Who knows, maybe I'll try to contribute my work to CPAN (with my company's approval) for others.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Storing credentials in a cross-platform binary file?
by juster (Friar) on Sep 12, 2008 at 05:56 UTC |