Granular policies allow you to configure row-level security for datasets and objects. They are used by restricted views and object security policies to determine which specific rows or object instances a user has permission to access.
A granular policy is a set of rules and logical operators that compare user attributes, columns or properties, and values to determine which data the user can see. Granular policies are flexible and support a range of comparisons and terms.
Before creating a granular policy, consider the following questions:
We recommend the following guidelines when designing a granular policy:
Below is a list of supported user attributes in granular policies:
ri.multipass..organization.When referencing a user, group, or organization, the policy requires the unique identifier (UUID) in both the policy column and the policy definition. Specifying names instead of IDs is not supported to prevent renaming-related issues.
Granular policies support the following comparison types:
Object security policies do not support less/greater than comparison operators.
Policies are defined as templates into which user attributes, group memberships, and data values can be filled. When the consuming application requests data (such as in Contour), the template is converted into a query. This query returns only rows or objects specific to the user's attributes and permissions.
A single policy can have up to ten comparisons. Granular policies weigh each comparison in the policy depending on whether the policy is comparing a collection or a constant against a field:
For example, in a basic policy:
The current policy construction limit is designed to put minimal constraints on a particular policy design. It provides little protection against a policy that could overwhelm weight limits.
If you receive weight limit errors when constructing policies, contact Palantir Support for assistance.
When you manage granular policies, consider two goals:
Granular policies introduce a set of assumptions about the data that backs them. Therefore, granular policies will only correctly control access to data as long as these assumptions are true. Consider whether the use case requires building out machinery to ensure that those assumptions hold and data stays secured if those assumptions are broken.
One way to solve this problem is by introducing a step in the pipeline directly upstream of the resource that checks the assumptions made about the data. These checks might include:
event_occurred_in_state has the value NY, another column in the dataset called state_name should have value New York. Have the transform check that this is true before surfacing this data to users.