Skip to content

You are viewing documentation for Immuta version 2022.5.

For the latest version, view our documentation for Immuta SaaS or the latest self-hosted version.

Write a Row Redaction Policy

Use Case

A company in the financial services industry analyzes two different customer portfolios to compare performance. Their compliance team has developed the following requirement to maintain compliance:

Compliance Requirement: Access to data is restricted to analysts' corresponding country or geographic region.

For this organization's purposes, they should write a redaction policy that restricts which rows in the data source are visible to users. To do so, they will use attributes created to limit data access to the users' specific country or region. The steps below use this scenario to illustrate the policy, but other policy builder options are noted throughout the tutorial.

  1. Navigate to the Data Policies tab on the Policies page.

    Policy Tab

  2. Click Add Policy, enter a name for your policy, and then select the Only show rows action from the first dropdown.

    Policy Name

  3. Choose where user from the next dropdown. Additional options include where the value in the column tagged and where, with the steps shown below:

    • Where user

      1. Choose the condition that will drive the policy from the next dropdown: is a member of a group or possesses an attribute.

        Policy Attribute

      2. Use the next field to choose the attribute, group, or purpose that you will match values against.

        Attribute Value

      3. Use the next dropdown menu to choose the tag that will drive this policy.

        Note: You can add more than one condition by selecting + ADD. The dropdown menu in the far right of the Policy Builder contains conjunctions for your policy. If you select or, only one of your conditions must apply to a user for them to see the data. If you select and, all of the conditions must apply.

        Condition Tag

    • Where the value in the column tagged

      1. Select the tag from the next dropdown menu.
      2. From the subsequent dropdown, choose is or is not in the list, and then enter a list of comma-separated values.
    • Where

      1. Enter a valid SQL WHERE clause in the subsequent field. When you place your cursor in this field, a tool-tip should appear that details valid input and the column names of your data source. See Custom WHERE Clause Functions for more information about specific functions.
    • Never

      The never condition blocks all access to the data source.

      1. Choose the condition that will drive the policy from the next dropdown: for everyone, for everyone except, or for everyone who.
      2. Select the condition that will further define the policy: is a member of group, is acting under a purpose, or possesses attribute.
      3. Use the next field to choose the group, purpose, or attribute that you will match values against.

      Never clause example

  4. Choose the condition for everyone to drive the policy. Additional options include for everyone except and for everyone who.

    Note: If you choose for everyone except, use the subsequent dropdown to choose the group, purpose, or attribute key / value pair for your condition. If you choose for everyone who as a condition, complete the Otherwise clause before continuing to the next step.

    Policy Condition

  5. Opt to complete the Enter Rationale for Policy (Optional) field, and then click Add.

    Global Row Redaction Policy

  6. Click the dropdown menu beneath Where should this policy be applied, and select On all data sources. Additional options include On data sources and When selected by data owners.

    All Data Access

    Note: If you select On data sources, finish the condition in one of the following ways:

    • Tagged: Select this option and then search for tags in the subsequent dropdown menu.

    • With columns tagged: Select this option and then search for tags in the subsequent dropdown menu.

    • With column names spelled like: Select this option, and then enter a regex and choose a modifier in the subsequent fields.

    • In server: Select this option and then choose a server from the subsequent dropdown menu to apply the policy to data sources that share this connection string.

    • Created between: Select this option and then choose a start date and an end date in the subsequent dropdown menus.

  7. Click Create Policy, and then click Activate Policy or Stage Policy.

    Policy Activation

Results

Once your policy is created, you can view it in the Data Policies tab on the Policy page.

Policy View

The image below displays the data returned by the query for a user in Mexico.

Data Results