This week, we tackled an exciting client project that involved designing a dashboard for their web platform. The key requirement? The dashboard needed to include row-level security features to ensure data access was restricted based on customer needs. My project manager tasked me with researching row-level security (RLS) in Tableau and recommending the best approach.
What is Row-Level Security?
Row-Level Security (RLS) in Tableau allows you to control which rows of data a user can see in a workbook or data source. This means, for example, that a regional manager can access only data relevant to her region, ensuring that sensitive information is protected. The beauty of RLS lies in its ability to provide personalized data access for various users while maintaining a single published view.
Methods for Implementing Row-Level Security
There are several approaches to implementing RLS in Tableau, each with its pros and cons:
- User Filters:
- How it Works: You manually map users to specific data values.
- Pros: Simple to set up.
- Cons: High maintenance, as updates are required for any user changes. Permissions must also be carefully managed to prevent unauthorized access.
- Dynamic User Filters:
- How it Works: Create a calculated field that automatically maps users to data values based on security information in the underlying data.
- Pros: Less manual intervention; filters are applied at the data level.
- Cons: Requires security information in your data, and permissions must still be managed carefully.
- Data Policies with Virtual Connections:
- How it Works: RLS is implemented at the connection level via data policies when Data Management is enabled on Tableau Server or Cloud.
- Pros: Centralized management of security; reduces the risk of exposing sensitive information.
- Cons: Requires Data Management licensing, and not every virtual connection will have a data policy.
- Impersonation:
- How it Works: Users can access only filtered views in SQL Server, leveraging "EXECUTE AS" permissions.
- Pros: Centralized security management in the database.
- Cons: Only works with SQL Server, and requires all users to exist within the database.
- Kerberos Delegation:
- How it Works: Tableau Server uses Kerberos credentials to execute queries on behalf of users, respecting RLS set in the database.
- Pros: Ensures user identity is preserved in access logs.
- Cons: Requires specific setup and configuration within the Active Directory domain.
- Initial SQL for Oracle VPD:
- How it Works: Run SQL commands to set up user-specific sessions upon connection.
- Pros: Allows user context to be established at load time.
- Cons: Not all databases support this feature, and there may be performance implications.
Comparison of Methods
Method |
Useful When |
Pros |
Cons |
Entitlements Table |
First-time RLS setup |
Easy to
test and scale |
Requires maintaining the table |
CONTAINS() with Extracts |
Pre-2018.3 extracts |
Leverages extract efficiencies |
Difficult
to switch back to live connections |
Impersonation |
All users exist in SQL Server |
Centralized security |
Only for SQL Server |
Kerberos |
RLS is
set up in the database |
User
names appear in access logs |
Requires AD integration |
Initial SQL |
The
database supports initial SQL and RLS |
Passes
parameters at load time |
Not all
databases support it |
Conclusion
As we design the dashboard for our client, understanding and implementing row-level security is crucial. The methods vary in complexity and suitability, so choosing the right approach will depend on the client's specific requirements and infrastructure. With careful planning and execution, we can ensure that their dashboard delivers secure, personalized insights for all users.