Configuration​
dbzar can be configured by creating on the configuration files below which identifies how to anonymize a database
Create any one of these files:
.dbzarrc
.dbzarrc.json
.dbzarrc.yaml
.dbzarrc.yml
.dbzarrc.js
.dbzarrc.cjs
dbzar.config.js
dbzar.config.cjs
Example​
// .dbzarrc
uri: mongodb://example:example@localhost
dbName: db1
tables:
- name: users
columns:
- name: firstName
provider: mask
- name: lastName
provider:
type: mask
options:
character: "#"
- name: products
columns:
- name: name
provider: fake
- name: price
provider:
type: random_number
options: { min: 100, max: 999 }
Structure​
uri
* (string) - connection string, where to connect todbName
* (string) - database name to processtables
(list ofTable
) - tables to process within the database
Table​
name
* (string) - table namecolumns
* (list ofColumn
) - columns to be processed
Column​
name
* (string) - column nameprovider
- (ProviderType
orProvider
) - how to anonymize the column.
ProviderType​
An enum (string) with one of the fields: mask
, fake
, scramble
Provider​
Contains a more detailed provider with options
type
* (ProviderType
) - type of the provideroptions
- provider options, see the different providers for more info
*
- required field