From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Siegfried Bilstein <sbilstein@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Thoughts on row-level security for webapps?
Date: Tue, 1 Jan 2019 10:49:40 -0800
Message-ID: <79848fa2-ed90-4f06-04f9-a068c341a682@aklaver.com> (raw)
In-Reply-To: <CAOd5ZkpQw7OG=bezbF9HDaM_TnSx=PHWGmmdZsL_XXbGKt_qmQ@mail.gmail.com>
References: <CAOd5ZkpQw7OG=bezbF9HDaM_TnSx=PHWGmmdZsL_XXbGKt_qmQ@mail.gmail.com>
On 12/31/18 8:57 AM, Siegfried Bilstein wrote:
> 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.
So there is still user information being passed in, correct?
>
> 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?
The ROLE will be determined by the user name used to make the
connection. Is it possible to change the connection login depending on
the website user privileges?
>
> --
> Siggy Bilstein
> CTO ofAyuda Care <https://www.ayudacare.com;
> Book some time <https://calendly.com/siggy-cto; with me!
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, sbilstein@gmail.com
Subject: Re: Thoughts on row-level security for webapps?
In-Reply-To: <79848fa2-ed90-4f06-04f9-a068c341a682@aklaver.com>
References: <CAOd5ZkpQw7OG=bezbF9HDaM_TnSx=PHWGmmdZsL_XXbGKt_qmQ@mail.gmail.com> <79848fa2-ed90-4f06-04f9-a068c341a682@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox