April 1, 2024

Empowering Data Security: Exploring Row-Level Security in Tableau

By Nikhil Dhole

Data analysis plays a crucial role in organizations making informed decisions. Implementing strong security measures is essential to protect the confidentiality and integrity of sensitive data.

Tableau, a popular data visualization tool, offers a powerful feature known as Row-Level Security (RLS) to control data access at the finest granularity. 

In this blog, we will explore the importance, implementation, and best practices of Row-Level Security in Tableau.

What is Row Level Security in Tableau?

Row-Level Security (RLS) is an essential feature in Tableau that offers a specific approach to data access control. It empowers organizations to specify which rows of data each user or group is authorized to view, ensuring data privacy and compliance with data regulations.

Why is Row-Level Security Important in Tableau?

RLS is important for many reasons, especially if your organization handles sensitive or confidential data. Here’s a list of five areas where RLS can shine:

  • Data Privacy Compliance

  • Confidentiality

  • Customized Data Access

  • Data Quality Assurance

  • Security and Data Manipulation

Rather than explore each of these areas in greater detail, let’s imagine a scenario where a business doesn’t implement RLS and what drawbacks they could expect. 

In our example, we’ll use a retail company that utilizes Tableau for sales analytics. Within this organization, various teams manage vast quantities of sales data to make decisions. On the surface, this seems fine, but in reality, there are several weaknesses, including these four:  

  • Customized Data Access: Without RLS, sales representatives may unintentionally access data from other regions or teams, leading to confusion and potential conflicts.

RLS ensures isolated access, allowing sales representatives to focus on relevant information tied to their accounts.

  • Confidentiality: RLS absence risks employees accessing and disclosing competitive insights from other departments, compromising strategic data. With RLS, one can maintain confidentiality by restricting access and safeguarding strategic sales data from unintentional exposure.

  • Data Quality Assurance: Sales representatives might access data from peers, leading to inaccurate performance metrics and incentive calculations. With RLS, one can have accurate performance evaluations by restricting access to specific data points and preventing manipulation.

  • Enhanced Data Security: Without RLS, there will always be a risk of unauthorized access and potential data manipulation, impacting the integrity of sales data. RLS enhances security by restricting unauthorized access and potential data manipulation, maintaining the integrity of sales data. With RLS, access will be limited at the row level, reducing the risk of unauthorized data access.

How to Apply RLS in Tableau

Now that we’ve covered the why behind RLS in Tableau, it’s time to explore two practical methods for implementing it in your organization. There are various ways to apply RLS, as seen below.

  1. Creating a static user filter

  2. Creating a dynamic user filter

  3. Using a data policy

  4. Use existing RLS in the database

  5. Pass user attributes

We will see how to create RLS using a few methods mentioned above.

1. Creating a Static User Filter

Prerequisites

To get started, you’ll need the following prerequisites below:

  1. Access to Tableau Desktop

  2. Access to Tableau Server / Online with at least five user groups created.

With these prerequisites in place, you’ll be well-prepared to explore the world of Row-Level Security in Tableau and harness its power for secure, data-driven decision-making.

  1. Log in to your Tableau server/ online and create a group of five users.

  1. Next, we’ll access a dashboard where we intend to implement row-level security. We’ll be utilizing the dashboard provided by Tableau Accelerator as below. You can access the link for it here.

  1. Sign in to your Tableau server / Online from Tableau Desktop

  2. Now, choose a single sheet and designate the field by which data access will be restricted. In our instance, we’ll employ Store Type to implement row-level security (RLS). To do this, navigate to the menu bar, select Server, then opt for Create User Filter, and finally, choose Store Type.    

  1. Now you should be able to see the five  users group created

  2. Assign different groups to different store types (Depending on which group should have access to which group).

  3. Select OK, and now you will see a new set field created at the end of dimensions named User Filter 1.

  1. Put this field on the filter shelf. Right-click on that user filter on the filter shelf and select Apply to Worksheets > All using this data source.

  2. Publish this dashboard to your Tableau Server / Online.

Congrats! You have created an RLS for the five user groups. When any user of any group logs in, they should be able to see the dashboard for the assigned Store Type. Note: Here, we can add user filter 1 to the data source filter.

If you need to edit or update the filter settings, right-click on the User Filter 1 field and click Edit Set. This will reopen the dialog box to adjust your user settings.

Limitations

Creating a manual user filter for row-level security can be effective in specific scenarios, but it also comes with several limitations:

Maintenance Overhead: Manually managing user filters requires ongoing maintenance. As users join, leave, or change organizational roles, the user filter configurations must be updated accordingly. This manual upkeep can be time-consuming and error-prone, especially in large organizations with frequent personnel changes.

Scalability Issues: In environments with many users or complex access control requirements, managing individual user filters can become unwieldy. Maintaining and updating filters becomes increasingly challenging as the number of users and data access rules grows.

Security Risks: Manual user filters may introduce security risks if not implemented properly. For example, if user filter configurations are not consistently applied or if there are vulnerabilities in the access control logic, unauthorized users may gain access to sensitive data.

Limited Flexibility: Manual user filters may lack flexibility in accommodating dynamic access control requirements. For example, if access permissions need to be dynamically adjusted based on contextual factors such as time of day, location, or user activity, manual user filters may not be able to adapt easily.

Performance Impact: Depending on the complexity of the user filter logic and the volume of data being filtered, applying manual user filters at runtime can introduce performance overhead. This overhead can impact query execution times and system responsiveness, particularly in high-traffic environments.

Potential for Errors: Manually configuring user filters increases the likelihood of errors, such as misconfigurations or inadvertent access grants. These errors can lead to data breaches, compliance violations, or other security incidents.

2. Creating a Dynamic User Filter

It’s possible to establish a Row-Level Security (RLS) system for dynamically changing users. To achieve this, we must generate a calculated field named Dynamic User Filter, utilizing a formula such as USERNAME() = Manager. Here, Manager refers to a column within the dataset. Implementing this formula will restrict access solely to users designated as managers.

Unlike static users with fixed roles or permissions, dynamic users may have changing roles or permissions over time. For example, an employee who is a manager today might not be a manager tomorrow.

A calculated field is a field in a database table whose values are derived from the values of other fields using a formula or expression. In this case, Dynamic User Filter is a calculated field that will determine which rows a user can access based on their role as a manager.

The formula used in the calculated field is USERNAME() = Manager. Here, USERNAME() is a function that returns the username of the current user accessing the database. Manager refers to a column in the dataset that presumably designates whether a user is a manager. So, this formula checks if the current user’s username matches the value in the Manager column.

By using this formula in the calculated field, only users whose usernames match the value in the Manager column will be granted access to the data. This effectively restricts access to only users identified as managers in the dataset.

Overall, implementing this calculated field with the specified formula enables dynamic row-level security, ensuring only managers can access relevant data in the database.

Limitations

Complexity: Implementing dynamic filters requires technical expertise and may involve complex logic.

Performance: Evaluating dynamic filters can slow query processing, especially with large datasets.

Scalability: Managing dynamic filters becomes challenging with a growing number of users and rules.

Security Risks: Dynamic filters may introduce vulnerabilities if not implemented securely.

Maintenance: Ongoing monitoring and updates are needed to keep dynamic filters accurate.

Granularity: Dynamic filters may lack fine-grained access control capabilities.

Audit and Compliance: Tracking changes and ensuring compliance may be complex with dynamic filters.

Dependency on User Attributes: The accuracy of user attribute data is crucial for effective dynamic filtering.

In summary, while dynamic user filters offer flexibility, they pose challenges in complexity, performance, scalability, security, maintenance, granularity, auditability, and data accuracy.

Conclusion

Row-level security in Tableau is a powerful tool that empowers organizations to control data access at a particular level. By implementing RLS, organizations can protect sensitive information, comply with data privacy regulations, and customize data access for different user groups. However, carefully planning, implementing, and maintaining RLS is crucial to ensure its effectiveness. 

With the right approach and best practices, Row-Level Security can be an asset in your data security arsenal, safeguarding your data and enabling secure data-driven decision-making. RLS ensures that your data story is not just a tale well told but a masterpiece.

Need help unlocking the most value out of Tableau for your organization? phData can help! Reach out today for answers, best practices, and actionable Tableau advice!

Data Coach is our premium analytics training program with one-on-one coaching from renowned experts.

Accelerate and automate your data projects with the phData Toolkit