Why masking rules end up in spreadsheets
Every team that copies production data into test, development or analytics environments sooner or later faces the same question: how do we keep the data realistic without exposing real customers?
The answer is rarely a single rule. A real masking project grows into long lists of decisions: which values can stay as they are, which must be grouped into broader categories, which patterns identify sensitive values, which exceptions apply to a particular system. Rollup rules in HushHush capture exactly these decisions: they replace values that match a pattern or fall within a range with a generalized replacement, so "Senior Accountant" becomes "Finance" and salaries between $50,000 and $74,999 become "$50Kâ$75K".
The people who know these values best are rarely the ones writing code. Data owners, analysts and testers know that job titles such as "Senior Accountant" and "Payroll Specialist" can simply become "Finance", or that internal codes starting with "TMP-" can be kept as they are. So the rules usually live where these people work: in Excel.
Until now, that meant an extra step. Someone had to turn the spreadsheet into the format the masking job expected, and a small mistake, such as a missing column, an extra separator or an empty value, could show up only when the job was already running, sometimes hours into a large database.
With HushHush 2.4.2, the spreadsheet is the rules file
CSV rules in the .NET API. Rollup rules saved as CSV now work in the .NET API components as well as in SSIS. If you build your own masking workflows in .NET, you can load the same CSV file that your SSIS packages use. One source of truth for both.
Validation before masking starts. HushHush 2.4.2 checks a CSV rules file thoroughly when it is loaded. If something is wrong, you get a clear message that says what is wrong and where, before any data is processed.
Plain text, easy to review. A CSV file is readable without special tools. Stored in version control, every rule change shows up as a clear line-by-line difference, so changes to masking rules can be reviewed and approved like any other change to your data pipeline.
A typical workflow
1. The data owner maintains the rules. A colleague who knows the data opens the rules in Excel, adds or updates rows and saves the sheet as CSV.
Example: Number rollup for salary ranges
Min,Max,Replacement
0,24999.99,0
25000,49999.99,25000
50000,74999.99,50000
75000,99999.99,75000
100000,9999999.99,100000
Example: String rollup for job titles
Pattern,IgnoreCase,UseRegex,Replacement
Accountant,true,false,Finance
Payroll,true,false,Finance
Engineer,true,false,Technology
Developer,true,false,Technology
Manager,true,false,Management
Director,true,false,Executive
Example: String rollup with regex patterns
Pattern,IgnoreCase,UseRegex,Replacement
"^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$",false,true,email@masked.com
^\d{3}-\d{2}-\d{4}$,false,true,000-00-0000
^\(\d{3}\) \d{3}-\d{4}$,false,true,(000) 000-0000
Example: DateTime rollup for date ranges
Min,Max,Replacement
2020-01-01 00:00:00,2020-12-31 23:59:59,2020-01-01 00:00:00
2021-01-01 00:00:00,2021-12-31 23:59:59,2021-01-01 00:00:00
2022-01-01 00:00:00,2022-12-31 23:59:59,2022-01-01 00:00:00
2023-01-01 00:00:00,2023-12-31 23:59:59,2023-01-01 00:00:00
2024-01-01 00:00:00,2024-12-31 23:59:59,2024-01-01 00:00:00
2. The file goes where your team keeps its configuration. That can be a shared folder or, better, your source repository, next to the SSIS packages or the code that uses it.
3. The masking job loads it. In SSIS, the Rollup component reads the file as before. In your own .NET code, it takes just a few lines:
using HushHush.MaskingLogic.SSRS;
using HushHush.MaskingLogic.Helpers;
// Example 1: Number rollup with inline CSV
var salaryRules = @"Min,Max,Replacement
0,24999.99,0
25000,49999.99,25000
50000,74999.99,50000
75000,99999.99,75000
100000,9999999.99,100000";
decimal salary = 67500.00m;
decimal maskedSalary = Mask.NumberRollup(salary, salaryRules, 0m, RollupConfigurationFormat.Csv);
// Result: 50000
// Example 2: String rollup for job titles
var titleRules = @"Pattern,IgnoreCase,UseRegex,Replacement
Accountant,true,false,Finance
Engineer,true,false,Technology
Manager,true,false,Management";
string jobTitle = "Senior Software Engineer";
string maskedTitle = Mask.StringRollup(jobTitle, titleRules, "Other", RollupConfigurationFormat.Csv);
// Result: Technology
// Example 3: DateTime rollup for hire dates
var dateRules = @"Min,Max,Replacement
2020-01-01 00:00:00,2020-12-31 23:59:59,2020-01-01 00:00:00
2021-01-01 00:00:00,2021-12-31 23:59:59,2021-01-01 00:00:00
2022-01-01 00:00:00,2022-12-31 23:59:59,2022-01-01 00:00:00
2023-01-01 00:00:00,2023-12-31 23:59:59,2023-01-01 00:00:00";
DateTime hireDate = new DateTime(2022, 6, 15, 9, 30, 0);
DateTime maskedDate = Mask.DateTimeRollup(hireDate, dateRules, new DateTime(2000, 1, 1), RollupConfigurationFormat.Csv);
// Result: 2022-01-01 00:00:00
4. Mistakes are reported, not discovered. Suppose a row is missing a value or has an invalid entry. Instead of a failed run, you see:
- The CSV header is missing column(s): Replacement. Expected header: Min,Max,Replacement.
- Invalid or out-of-range decimal 'abc' in column Min at CSV row 3. Use plain notation with '.' as the decimal separator.
- Min '100000' is greater than Max '50000' at CSV row 5.
- Invalid boolean 'yes' in column IgnoreCase at CSV row 2. Expected 'true' or 'false'.
Fix the row, save, run again. The masked copy of your database is ready for testing, development or analytics, with the same rules applied every time.
Tips for working with CSV rules
- Keep one file per subject. For example, separate files for departments, product codes and job titles. Small files are easier to review and reuse across projects.
- Agree on the encoding and separator. HushHush expects UTF-8 encoding and comma as the separator. Excel may save files differently depending on regional settings, so check this once and write it down for the team.
- Version your rules. When the rules live next to the packages that use them, you always know which rules produced which test data.
- Try changes on a small sample first. Run the job on a small copy of the data before applying new rules to a full database.
Questions you might have
Do I have to convert my existing XML rules? No â XML rules continue to work unchanged. The format parameter defaults to Xml, so existing code needs no changes. You can move to CSV when it suits you.
Can I use the same CSV file in SSIS and in .NET? Yes â the format is identical. A CSV file created for an SSIS Rollup component works in the .NET API, and vice versa.
What exactly does the validation check? The Troubleshooting section of the manual lists every validation message, its cause and how to fix it.
Also in 2.4.2
This release includes several fixes that make HushHush more reliable. See the release notes for the full list.
HushHush continues to run on Windows 10, and no action is needed to upgrade. Microsoft now provides only security updates for Windows 10, so we test HushHush fully on Windows 11 and recommend planning your move to it. See the system requirements.
Try it on your own data
Request a free trial. One package covers SSIS 2016, 2017, 2019 and 2022 and works with SQL Server, MySQL, IBM Db2 and Oracle. Point it at a copy of your database, add a CSV file with a few rules and see how your masked data looks. Questions along the way? Write to us at info@mask-me.net.