Skip to content
A support group for people who have PII in their mysql databases.
Branch: master
Clone or download
Pull request Compare This branch is 70 commits ahead of davedash:master.
Latest commit 6046fd1 Mar 11, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
anonymize upgrade the module to use items def Oct 11, 2018
tests manual merge Oct 28, 2018
.coveragerc omit package tests Jun 28, 2018
.gitignore
.travis.yml updating travis file Jun 29, 2018
LICENSE Create LICENSE Nov 16, 2015
Makefile adding a silent task Oct 28, 2018
README.md
requirements.txt package secure Mar 11, 2019
requirements_dev.txt changing version of pytest Jun 28, 2018
setup.py package secure Mar 11, 2019

README.md

Mysql Anonymous

Build Status Coverage Status Requirements Status

Contributors can benefit from having real data when they are developing. This script can do a few things (see sample1.yml or sample2.yml):

  • Truncate any tables (logs, and other cruft which may have sensitive data)

  • Nullify fields (emails, passwords, etc)

  • Fill in random/arbitrary data:

    • Random integers
    • Random IP addresses
    • Random Cell Phone
    • Random Phone
    • Random CPF
    • Random CNPJ
    • Email addresses
    • Usernames
    • Text Loren Ipsum
  • Delete rows based on simple rules: e.g. DELETE FROM mytable WHERE private = "Yes":

     database:
         tables:
             mytable:
                 nullify:
                     private: Yes
  • Apply rules exception in some cases: e.g. UPDATE mytable SET cellphone=NULL WHERE id NOT IN(556, 889):

    database:
        tables:
            mytable:
                exception:
                 - 556
                 - 889
                nullify:
                 - cellphone
  • Define an other name for primary key of table: e.g. UPDATE mytable SET `email` = CONCAT(user_id, '@example.com'):

    database:
        tables:
            primary_key: user_id
            mytable:
                random_email: email

Installation

pip install https://github.com/riquellopes/mysql-anonymous/tarball/master

CookBook

    anonymize --sample-one
    anonymize --sample-two
    anonymize -y database.yml
You can’t perform that action at this time.