pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Achilleas Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Thoughts on row-level security for webapps?
Date: Wed, 2 Jan 2019 12:31:34 +0200
Message-ID: <75a43cb2-2e87-2628-ea69-c3b69ee997f5@matrix.gatewaynet.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 31/12/18 6:57 μ.μ., 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.
>
> 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.

Why?

> Is this a common usage pattern for SQL security? Any gotchas relying on RLS?
>
> -- 
> Siggy Bilstein
> CTO ofAyuda Care <https://www.ayudacare.com;
> Book some time <https://calendly.com/siggy-cto; with me!


-- 
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt

view thread (5+ messages)  latest in thread

Message-ID: <75a43cb2-2e87-2628-ea69-c3b69ee997f5@matrix.gatewaynet.com>
Permalink:  ../75a43cb2-2e87-2628-ea69-c3b69ee997f5@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/75a43cb2-2e87-2628-ea69-c3b69ee997f5@matrix.gatewaynet.com

 · 

reply

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: achill@matrix.gatewaynet.com
  Subject: Re: Thoughts on row-level security for webapps?
  In-Reply-To: <75a43cb2-2e87-2628-ea69-c3b69ee997f5@matrix.gatewaynet.com>
  References: <CAOd5ZkpQw7OG=bezbF9HDaM_TnSx=PHWGmmdZsL_XXbGKt_qmQ@mail.gmail.com> <75a43cb2-2e87-2628-ea69-c3b69ee997f5@matrix.gatewaynet.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