Questions tagged [row-level-security]

Row-level security is database security term which relates to the ability to define and enforce access control logic on rows of data such that a user can only retrieve the rows of data he or she is allowed to view.

Row-level security is database security term which relates to the ability to define and enforce access control logic on rows of data such that a user can only retrieve the rows of data he or she is allowed to view.

Several database vendors provide row-level security mechanisms. For instance:

  • Oracle provides Virtual Private Database (VPD), a free feature of the Oracle Enterprise Database.
  • MySQL provides fine-grained access control (FGAC). This is further detailed in this 2006 article.
  • IBM DB2 provides row/column-level access control (RCAC). This is further detailed in this IBM knowledge base.
  • SQL Server and Azure SQL Database provide Row-Level Security (RLS). This is further detailed in the MSDN product documentation.

In row-level security, a user can ask to view a set of data e.g. medical records. The database table (or view) contains a complete set of medical records but only returns those records the user is entitled to view. The authorization is typically driven through the configuration of VPD/RCAC/FGAC or through an access control policy e.g. doctors can view the medical records of patients they are assigned to.

Row-level security is becoming more prevalent with the rise of and , technologies that help standardize access control.

An extension of row-level security is the ability to apply cell-level security. This space has been coined as dynamic data masking by Gartner analyst Joseph Feiman (see this report and these videos on data masking).

There are several third party vendor solutions which provide row-level security / dynamic data masking:

  • GreenSQL
  • Informatica DDM
  • Axiomatics Data Access Filter MD

Additional information and vendors are listed on Wikipedia.

367 questions
0
votes
1 answer

Row Level Security using Azure Active Directory Authentication - WEB API

I'm designing a Single Page Application in React + .NET Core and now I'm facing with the concept of visibility related to the application profiles (for example Admin will see all data, Team Leader will see all the data related to his team and so…
0
votes
1 answer

Does row-level security (RLS) apply on a join statement?

Given the following (simplified) tables: users ----- id (pk) posts ----- id (pk) user_id (fk) likes ----- user_id (pk) post_id (pk) If I run the following query to get which posts a user (?) liked: SELECT * FROM posts p INNER JOIN likes l ON…
bryan-vh
  • 151
  • 1
  • 9
0
votes
1 answer

How should I go about optimizing this row level security policy for reading an event?

Here is a summary of my tables / entities that I am using for this policy (simplified for SO). user ---- id (pk) event ----- uuid (pk) host_id (fk -> user) privacy: int friendship ---------- user_id (pk, fk -> user) friend_id (pk, fk ->…
bryan-vh
  • 151
  • 1
  • 9
0
votes
1 answer

azure sql server row level security with ad users

Is it possible to somehow have Azure SQL Server automatically use ad users (in row level security) without always creating a login, or automatically creating a login for every user of an ad group?
0
votes
0 answers

How to use Row-Level Security to weed out deleted records

We're looking for help with an issue that I hope can be solved with row-level security. We have 160 tables feed by a data lake that are in turn used by another application. There is a field in all tables called IsDeleted that is 0 if the record is…
RBruce
  • 21
  • 1
0
votes
1 answer

I want all users which are not members of my User table to see everyones data

I have a table with Sales Teams (DimSalgsTeams) and another one with all salelsmen for all teams (DimSaelgere), and only a users (salesmen) from the same Team can see each others rows. My model works great, but the issue is that all other members of…
0
votes
1 answer

PostgreSQL RLS is not applied as intended

I have a function a function current_user_selected_upr that returns a text. I want to use this function to apply a rls policy : create or replace function current_user_selected_upr() returns text stable language sql as $$ select 'IDF' as…
Léo Coletta
  • 1,099
  • 2
  • 12
  • 24
0
votes
1 answer

How do I write a DAX expression in Power BI for row-level security?

I am trying to implement row-level security on one table based on a separate users table. I've seen this talked about in places like this, but haven't been able to get things working for my case. Users table: Transactions table: The table I'd like…
RobC
  • 1,303
  • 3
  • 15
  • 32
0
votes
1 answer

Row-Level Security Predicate Filter

On Oracle 19c. We have users whose accounts are provisioned by specifying a comma separated list of department_code values. Each of the department_code values is a string of five alpha-numeric [A-Z0-9] characters. This comma separated value list…
Alex Bartsmon
  • 471
  • 4
  • 9
0
votes
1 answer

How to maintain a copy of a table in memory in Azure SQL?

I am new to Azure and I need help. We have a table USERS in Azure SQL on disk. This table is populated by admin team and we use the table data. This table is used for implementation of Row Level Security(RLS). We now want to create a new…
0
votes
3 answers

Row Level Security for Groups in Amazon Quicksight

How can I create groups in Amazon Quicksight to create a dashboard with row level security? In this guide https://docs.aws.amazon.com/quicksight/latest/user/managing-users-enterprise.html it says that you can go to Manage QuickSight > Manage Users…
eduardoftdo
  • 382
  • 3
  • 13
0
votes
1 answer

How can I make a single RLS role in power BI with multiple values?

I am trying to make several roles in PBI but if I select more than variable, my rule won't work. Example [Company Profile Country] = "US" && [Company Profile Country] = "CA" I don't get any error messages, but nothing shows up when I 'view as'.…
courty340
  • 101
  • 3
  • 16
0
votes
1 answer

RLS and Viewer and Member Permissions in New Workspace

We have a workspace that was recently updated. Inside this workspace, we have a Power BI dataset with RLS. The primary use cases for this dataset is two-fold: Users consume the pre-built report with their filter context applied. Users utilize…
crisher
  • 15
  • 1
  • 3
0
votes
1 answer

PowerBI Dynamic Row Level Security not working in Service

I have created and tested a rule in the powerbi app that works fine in "view as", but when I publish my dataset with the rule, the report in the service is not working. I am not sure if it has anything to do with that I am an admin on the project…
courty340
  • 101
  • 3
  • 16
0
votes
1 answer

How to apply RLS on table using value from same table

I have a table like below and two users Soni and Garve. I want to show few orders only to users based on their role and using value in string_to_match column. user Soni can see order_id like below, all product_keys of an order_id if order_id has…
Hari
  • 299
  • 4
  • 12