The data you store on your database will likely consist of customer data. This data is valuable not only to you, but to other people too.
If you work in the finance, healthcare or MoD sector then you have to be really careful to ensure this data does not get into the wrong hands.
How can you do this if you need your team working with real data due to some obscure bug.
Solution: Obfuscate your database.
This means changing all personally identifiable data before it gets onto any local environments.
Info a ruby gem
Command line script to generate mysql dump with encrypted data. This is a wrapper around the my_obfuscate gem.
You create the profiles you want to obfuscate data with and then run it on a mysql database producing a mysqldump or against an existing mysqldump.
Get a Mysqldump of a live database running obfuscation.
strike dump mysql://username:password@localhost/db_production --profile=tables.rb > obfuscated_dump.sql
Get a new Mysqldump of an existing mysqldump runningobfuscation.
cat original_dump.sql | strike obfuscate --profile=tables.rb > obfuscated_dump.sql
Creating your own profile is easy. They give an example on their website and looking at the my_obfuscate gem you can see many more options.
Creating your own function then gives you lots of power to really return the type of data you want.
Below is my example:
Make this a simple bash command
For my use I only run strike against backup mysqldumps.
Note: If you do run against your own backups, ensure that you mysqldump with -c option
mysqldump -c --hex-blob -uroot -proot mydb > mydump.sql
These scripts I built make it easy to setup your environment so that the following command will obfuscate any backup you wish.
So you can now run this to obfuscate your dumps
Hope this script helps others out there