Thor Logo dbatools

Masking

Invoke-DbaDbDataMasking

Sander Stad (@sqlstad, sqlstad.nl) | Chrissy LeMaire (@cl, netnerds.net)

Invoke-DbaDbDataMasking View Source Sander Stad (@sqlstad, sqlstad.nl) , Chrissy LeMaire (@cl, netnerds.net) Windows, Linux, macOS Synopsis Replaces sensitive production data with randomized values using configurable masking rules Description Replaces sensitive data in SQL Server databases with randomized values based on a JSON configuration file. This enables DBAs to create safe, non-production datasets for development, testing, and training environments without exposing real customer data. The function processes tables row-by-row, applying masking rules like generating fake names, addresses, phone numbers, or random strings while preserving data relationships and referential integrity.

Read more

New-DbaDbMaskingConfig

Sander Stad (@sqlstad, sqlstad.nl) | Chrissy LeMaire (@cl, netnerds.net)

New-DbaDbMaskingConfig View Source Sander Stad (@sqlstad, sqlstad.nl) , Chrissy LeMaire (@cl, netnerds.net) Windows, Linux, macOS Synopsis Scans database tables to detect sensitive data and creates a JSON configuration file for data masking Description Analyzes SQL Server database tables and columns to automatically detect potentially sensitive information (PII) and generates a JSON configuration file that defines how to mask each identified column. The function uses pattern matching against column names and data sampling to identify sensitive data like Social Security Numbers, email addresses, phone numbers, and other PII based on predefined patterns and known column naming conventions.

Read more

Test-DbaDbDataMaskingConfig

Sander Stad (@sqlstad), sqlstad.nl

Test-DbaDbDataMaskingConfig View Source Sander Stad (@sqlstad), sqlstad.nl Windows, Linux, macOS Synopsis Validates data masking configuration JSON files for structural and logical errors Description Validates data masking configuration JSON files by checking column properties, data types, masking types, and action configurations against dbatools requirements. Returns detailed error information for any tables and columns that fail validation, helping you identify configuration issues before running data masking operations. Checks include required/allowed column properties, supported SQL Server data types, valid masking and subtype combinations, date range validations, and action property requirements.

Read more