0.3.1 • Published 3 years ago

mongodb-anonymizer v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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

:point_right: 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
0.3.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.2.6

3 years ago

0.2.3

3 years ago

0.3.1

3 years ago

0.2.2

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago