mongodb-anonymizer
TypeScript icon, indicating that this package has built-in type declarations

0.3.1 • Public • Published

mongodb-anonymizer

MongoDB anonymzer tool. Export your MongoDB database anonymized from source to target. Replace all sensitive data thanks to faker.

oclif Version License

Usage

Run this command by giving a source URI and target URI (no need to install first thanks to npx):

npx mongodb-anonymizer \
  --uri=mongodb://localhost:27017/source \
  --targetUri=mongodb://localhost:27017/anonymized

☝️ Be careful, since target collections will be removed.

Specify list of fields to anonymize

Use --list option with a comma separated list of column name:

npx mongodb-anonymizer  \
  --uri=mongodb://localhost:27017/source \
  --targetUri=mongodb://localhost:27017/anonymized
  --list=email,firstName,lastName,phone

Specifying another list via --list replace the default automatically anonymized values:

email,name,description,address,city,country,phone,comment,birthdate

You can also specify replacements for a specific collection:

users.email,products.price

Customize replacements

You can also choose which faker function you want to use to replace data (default is faker.random.word):

npx mongodb-anonymizer  \
  --uri=mongodb://localhost:27017/source \
  --targetUri=mongodb://localhost:27017/anonymized
  --list=firstName:faker.name.firstName,lastName:faker.name.lastName

👉 You don't need to specify faker function since the command will try to find correct function via column name.

You can use plain text too for static replacements:

npx mongodb-anonymizer  \
  --uri=mongodb://localhost:27017/source \
  --targetUri=mongodb://localhost:27017/anonymized
  --list=textcol:hello,jsoncol:{},intcol:12

/mongodb-anonymizer/

    Package Sidebar

    Install

    npm i mongodb-anonymizer

    Weekly Downloads

    14

    Version

    0.3.1

    License

    MIT

    Unpacked Size

    12.2 kB

    Total Files

    7

    Last publish

    Collaborators

    • rap2hpoutre