Customize masking

We're going to customize classification to do the following:

A. Add a custom masking

B. Supply a custom dataset

C. Set custom date/time formats


These customizations will be done using the options file passed to the masking.

This can also be done by editing the masking.json file, but any changes will get overwritten next time mapping is run.

A. Add a custom masking

  1. {
  2. "tables": [
  3. {
  4. "schema": "dbo",
  5. "name": "Territories",
  6. "columns": [
  7. {
  8. "name": "TerritoryDescription",
  9. "dataset": "Cities"
  10. }
  11. ]
  12. }
  13. ]
  14. }

This configures the TerritoryDescription column of the dbo.Territories table to be masked as "Cities".

B. Supply a custom dataset

  1. {
  2. "datasets": [
  3. {
  4. "name": "Websites",
  5. "type": "List",
  6. "values": [
  7. "https://www.example.com",
  8. "https://www.test.com",
  9. "https://www.google.com"
  10. ]
  11. }
  12. ]
  13. }

This supplies a custom dataset, "Websites", that will be used in masking.

C. Set custom date/time formats

  1. {
  2. "settings": {
  3. "dateTimeFormats": [
  4. "YYYY-MM-dd",
  5. "yyyy-mm-dd HH:mm:ss"
  6. ]
  7. }
  8. }

This supplies custom date/time formats to be used when masking date/time values.

masking-options.json

Putting the configurations for A-C above together into one options file produces the following:

  1. {
  2. "tables": [
  3. {
  4. "schema": "dbo",
  5. "name": "Territories",
  6. "columns": [
  7. {
  8. "name": "TerritoryDescription",
  9. "dataset": "Cities"
  10. }
  11. ]
  12. }
  13. ],
  14. "datasets": [
  15. {
  16. "name": "Websites",
  17. "type": "List",
  18. "values": [
  19. "https://www.example.com",
  20. "https://www.test.com",
  21. "https://www.google.com"
  22. ]
  23. }
  24. ],
  25. "settings": {
  26. "dateTimeFormats": [
  27. "YYYY-MM-dd",
  28. "yyyy-mm-dd HH:mm:ss"
  29. ]
  30. }
  31. }

This should be saved into a file called masking-options.json, and will be passed into the masking step when it is run.



Didn't find what you were looking for?