Thoughts on row-level security for webapps? - Mailing list pgsql-general

From Siegfried Bilstein
Subject Thoughts on row-level security for webapps?
Date
Msg-id CAOd5ZkpQw7OG=bezbF9HDaM_TnSx=PHWGmmdZsL_XXbGKt_qmQ@mail.gmail.com
Whole thread Raw
Responses Re: Thoughts on row-level security for webapps?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: Thoughts on row-level security for webapps?  (Achilleas Mantzios <achill@matrix.gatewaynet.com>)
Re: Thoughts on row-level security for webapps?  (Stephen Frost <sfrost@snowman.net>)
List pgsql-general
Hi all, 

I'm evaluating using a tool called Postgraphile that generates a GraphSQL server from a postgres setup. The recommended way of handling security is to implement RLS within postgres and simply have the webserver take a cookie or similar and define which user is querying data. 

I've normally built webapps like this: pull out user id from a session cookie -> the API endpoint verifies the user and whether or not it has access to the given data -> app code mutates the data. 

With Postgraphile the request specifies the mutation and the server processes the request and relies on Postgres to determine if the user has correct access rights. 

It seems like I would need to create a ROLE for every single member that signs up for my website which I'm a little concerned about. Is this a common usage pattern for SQL security? Any gotchas relying on RLS?

--
Siggy Bilstein

pgsql-general by date:

Previous
From: chiru r
Date:
Subject: Relocatable Binaries (RPMs) : custom installation path for PostgreSQL
Next
From: Jeff Janes
Date:
Subject: Re: getting pg_basebackup to use remote destination