Database tasks
A ruleset consists of a list of tasks to be performed in sequence on
the target database. Tasks are performed serially from top to bottom,
but special serial and parallel tasks can be used to nest other tasks
within them for performance (parallelism) or dependency management.
The four largest database tasks have their own pages: Table masks, Mask a primary key or unique key (deprecated), Build a temporary table, and Run SQL. Tasks can also be nested with parallel and serial tasks.
Sensitive data discovery
The run_data_discovery task type inspects the metadata of your database, searching for columns
which are likely to contain sensitive data. On completion, a report is generated containing a
summary of all identified columns, and their current masking coverage. It is recommended to include
a single run_data_discovery task in your rulesets to help ensure complete masking coverage and
provide ongoing protection as new sensitive data is added to your database.
See the Sensitive Data Discovery guide for more information on this feature.
Note: The
run_data_discoverytask type is not currently supported for Amazon DynamoDB.
Sensitive data discovery parameters
This task type does not have any parameters.
Sensitive data discovery example
The following shows an example ruleset that will execute only the run_data_discovery task
and no masking tasks. This example usage may be useful when starting a new ruleset from
scratch to determine a starting point for developing your masking rules.
The run_data_discovery may also be included in a ruleset alongside other masking tasks to
provide continuous feedback on
the masking coverage provided by the ruleset.
version: '1.0'
tasks:
- type: run_data_discovery
Schema discovery
The run_schema_discovery task type inspects the metadata of your database, searching for schemas, tables, and columns
and can flag certain columns which are likely to contain sensitive data. On completion, a report is generated containing
a summary of all identified schemas, tables, columns, and relevant metadata of the data within the columns.
See the Schema Discovery guide for more information on this feature.
Note: The
run_schema_discoverytask type is not currently supported for Amazon DynamoDB.
Schema discovery parameters
This task type does not have any parameters.
Schema discovery example
The following shows an example ruleset that will execute only the run_schema_discovery task
and no masking tasks. This example usage may be useful when starting a new ruleset from
scratch to determine a starting point for developing your masking rules.
version: '1.0'
tasks:
- type: run_schema_discovery
Subsetting
Subsetting is the process of reducing a set of data in a database to a representative sample, to create a smaller dataset for demonstration, training, testing, and similar purposes.
DataMasque's subset task allows you to subset any number of tables and schemas in the database.
The proportion of data to be retained can be specified globally, then customized for each table.
Referential integrity is automatically maintained.
For full information about the subset task,
refer to the Subsetting section.
Truncate a table
Use the truncate_table task type to specify tables to be truncated by
DataMasque. All rows will be deleted, but the table structure will be left in
place.
Truncate a table parameters
table(required): The name of the table to truncate. The table name can be prefixed with a schema name to reference a table in another schema.
Truncate a table example
tasks:
- type: truncate_table
table: history_table
...
Notes:
- The
truncate_tabletask type does not run in dry run mode.- The
truncate_tabletask type is not currently supported for Amazon DynamoDB databases.- The
truncate_tabletask type does not properly truncate on IBM Db2 LUW or IBM Db2 for i databases, instead it deletes all rows in the table. See IBM Db2 LUW Limitations and IBM Db2 for i Limitations.