Anonymize command-line reference
Published 16 October 2023
This page provides details for each of the commands available on Anonymize CLI.
Classify
Automatically discover which columns of a database contain PII (personally identifiable information).
rganonymize classify --database-engine SqlServer --connection-string "[connection string]" --classification-file classification.json
Option | Required? | Notes |
---|---|---|
--database-engine | The type of the database to classify. Must be one of:
| |
--connection-string | The connection string of the database to classify. | |
--classification-file | The file path to save the classification to, including file name and file extension. | |
--options-file | The file path to an options file. | |
--output-all-columns | Include all columns in the classification output file, including columns with no classification. | |
--output | The format to use for the output classification file. Can be one of:
| |
--output-schema-file | Output a schema file to aid with hand editing the classification file. The schema can be used with some IDEs to provide prompts and documentation on the expected structure when editing. | |
| The verbosity level to log at.
| |
| Show help and usage information. |
Map
Maps a classification file to a masking file.
This command provides the integration between automatic discovery of PII (Classify) and automatic data anonymization (Mask).
rganonymize map --classification-file classification.json --masking-file masking.json
Option | Required? | Notes |
---|---|---|
--classification-file | The file path of the input classification file, including file name and file extension. | |
--masking-file | The file path of where to save the output masking file, including file name and file extension. | |
--options-file | File path to an options file. | |
--output | The format to use for the output classification file. Can be one of:
| |
--output-schema-file | Output a schema file to aid with hand editing the classification file. The schema can be used with some IDEs to provide prompts and documentation on the expected structure when editing. | |
| The verbosity level to log at.
| |
-?, -h, --help | Show help and usage information. |
Mask
Replaces real values in a database with realistic fake data through data substitution.
rganonymize mask --database-engine SqlServer --connection-string "[connection string]" --masking-file masking.json
Option | Required? | Notes |
---|---|---|
--database-engine | Type of the database to classify Must be one of:
| |
--connection-string | The connection string of the database to classify. | |
--masking-file | The file path of the input masking file, including file name and file extension. | |
--options-file | The file path to an options file. | |
--connection-timeout | The timeout (in seconds) to use when connecting to the database. Default: 15s | |
--command-timeout | The timeout (in seconds) to use when executing commands against the database. Default: 30s | |
--deterministic-seed | The seed to use for deterministic masking. | |
--dry-run | Perform a dry-run with no masking. This is a 'validation only' option that allows you to ensure your masking file and options file are configured correctly without modifying the database. If issues are found, they are sent to STDOUT in a JSON structure. This gives you specific information about the issues, and helps you identify and fix any problems before they arise. | |
| The verbosity level to log at.
| |
-?, -h, --help | Show help and usage information. |
Options
Generates an options file containing the Redgate supplied default rules.
The options file will contain two sections:
- a section to disable the default rules.
- a section that defines the default rules as custom rules, allowing them to be altered as necessary.
rganonymize options default-classification-rules --path options.json
Option | Required? | Notes |
---|---|---|
--path | The path of the options file to generate. | |
--output | The format to use for the output classification file. Can be one of:
| |
--output-json-schema | Output a schema file to aid with hand editing the classification file. The schema can be used with some IDEs to provide prompts and documentation on the expected structure when editing. | |
-?, -h, --help | Show help and usage information. |