DataMasque Portal

Introduction to Ruleset Libraries

What are Ruleset Libraries?

Ruleset libraries (commonly referred to as just libraries) are YAML documents containing reusable parts of a ruleset. This feature allows the same mask, rule, or task to be applied repeatedly without having to write multiple copies of the same ruleset YAML.

The library format is very flexible, allowing specification of anything from a single field value to full tasks, such as mask_table and mask_file, with conditionals and masking rules.

Ruleset libraries are compatible with both database and file masking.

Note: In-flight masking plans do not currently support use of ruleset libraries.

When to Use Ruleset Libraries

Ruleset libraries deduplicate content within or between rulesets. Common cases:

  • Multiple tables, schemas, or columns share the same masks.
  • Several masks or tasks reference a constant value (e.g. a from_choices list or run_sql snippet) that you want defined in one place.
  • You want related mask definitions grouped together for easier maintenance, rather than scattered throughout your ruleset YAML.

Managing Libraries

See Managing Libraries for details on creating, viewing, editing, and deleting libraries in the UI.

Permissions

Administrators can create, view, modify and delete ruleset libraries.

Users with the Mask Builder role can view ruleset libraries. However, in order to create, modify or delete a ruleset library, the user must also have the Manage Ruleset Libraries permission. This is assigned on the Users page when creating or modifying a user by enabling the Can Manage Ruleset Libraries checkbox:

Can Manage Ruleset Libraries checkbox

Users with the Mask Runner role cannot view, create, nor modify rulesets, and likewise cannot do anything with ruleset libraries either.

Ruleset Library Tutorial

A tutorial on how to create and use a ruleset library is available on the Tutorial page.

Next Steps

  • Read and understand the structure of a ruleset library.
  • Refer to the referencing guide to understand how to use references to libraries in your ruleset.
  • Consult the troubleshooting guide if you encounter errors or unexpected behaviour.