It is also possible to mask substrings in columns containing character datatypes. In order to do this, enter values for BOTH the "Substr start" and "Substr length" columns in the mapping csv.
Note:
The values must both be integers > 0 (positioning starts at the
value 1, not at 0).
Masking function should not be SHUFFLE
, WHERE
,
AND
, OR
, DELETE
or
TRUNCATE
.
If the substring specified does not exist in the column to be masked (the column value is too short), the column will be padded with blanks, then masked.
Example: If varchar column contains "abc", and your substring starts from position 5 for 2 characters using FIXED (1"2"), then the masked value will be "abc12".
Note:
If the column is null and keepnulls=y applies, then the column will
not be masked.
If the masking value is bigger than the substring specified then it will be truncated.
Example: If a column contains "abcdefghi" and you attempt to mask from position 2 for 2 characters using ("FIXED 123"), then the masked value will be "a12defghi"
If the masking value is smaller than the substring specified, then it will be padded with blanks.
Example: If a column contains "abcdefghi" and you attempt to mask from position 2 for 4 characters using FIXED ("1"), then the masked value will be "a1 ghi".
If you specify a cross-reference, then the old and new values used to read and update the xref table will be the full column contents (not just the substring).
Example: To mask characters 13 to 26 of column RAWDATA in table ORIGINAL with "7777777777777", the mapping csv row would be:
originalpos,rawdata,FILL,7,,,,,,,,,,13,13
or
originalpos,rawdata,FIXED,7777777777777,,,,,,,,,,13,13,
In the audit, the function name will be suffixed with the start:length parm, "FIXED(13:13)".
When applying multiple functions to the same column, the functions should be listed in consecutive rows in the mapping csv, as shown below:
There is no limit to the number of masking functions performed on each column, however, KeepNulls should be set the same for all of these functions.
Notes:
In the example above, the mapping csv shows that a mask of column ACCOUNT_NUMBER in table PAYMENT_OPTIONS with a zero padded sequence in positions 7 to 16, expressed as:
caaccounts,numberx,SEQNUMBER,1000000001,,,,,,,,,,7,10, caaccounts,numberx,FIXED,0,,,,,,,,,,7,1,
Note:
SEQNUMBER returns a left-aligned non-padded number, so the sequence
is started at 1000000001 and the leading digit is then set to 0.
In the audit report, the function names will be suffixed with start:length parameters and concatenated together, for example, "SEQNUMBER(7:10) FIXED(7:1)"
Note:
If cross-referencing is specified, the value used to lookup and
update the cross reference table is the whole column value, not a substring of
the value.