From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re: Limiting the operations that client-side code can perform upon its database backend's artifacts
Date: Wed, 28 Sep 2022 22:03:17 +0200
Message-ID: <20220928200317.2ntj7ejvysjje55a@hjp.at> (raw)
In-Reply-To: <5B23D9B8-56E8-458F-AD3D-B5F88AAB2844@yugabyte.com>
References: <3D119733-6784-4E84-98E4-5124E69D43F9@yugabyte.com>
<20220927065858.ibrmzrrbefjq5o4l@jrouhaud>
<20220927222637.aolob6gk3kuyirfs@hjp.at>
<87E125A5-A4B8-4BD6-9E9C-7ABF77650F3F@yugabyte.com>
<20220928011353.zo7enlnig5vvpowe@jrouhaud>
<5B23D9B8-56E8-458F-AD3D-B5F88AAB2844@yugabyte.com>
On 2022-09-27 19:29:39 -0700, Bryn Llewellyn wrote:
> I interpreted what Tom wrote to mean that he flatly rejected the idea
> that a database design was possible that prevented a client session
> that authorized as a role, that's designed for that purpose, from
> dropping tables and otherwise arbitrarily corrupting stuff. I expect
> that I completely misunderstood his point.
I think you did. What he was saying was that a database design which
uses only one single role which both owns all the objects and executes
all code on behalf of the user can not be secure. At the very least you
need two roles: One which owns the objects and one which can only use
the objects in a way allowed by the business logic and is not allowed to
change that logic (This is the case you demonstrated). In many cases
this should be even more fine-grained, and at the extreme end every user
could actually have several roles, each with only the minimal privileges
required.
(I have often observed that we tend to throw away and build permission
systems at every layer of the stack: The OS has a system of users and
permissions. But the database server runs as a single user (postgres)
which has access to all the data files. So it has to implement its own
system of roles and permissions. Then an application developer comes
along and writes an app which uses a single database role which has
access to all the data. So it again has to implement its own system of
users and permissions ...)
hp
--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp@hjp.at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"
Attachments:
signature.asc (application/pgp-signature, 832B) download
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: hjp-pgsql@hjp.at
Subject: Re: Limiting the operations that client-side code can perform upon its database backend's artifacts
In-Reply-To: <20220928200317.2ntj7ejvysjje55a@hjp.at>
References: <3D119733-6784-4E84-98E4-5124E69D43F9@yugabyte.com> <20220927065858.ibrmzrrbefjq5o4l@jrouhaud> <20220927222637.aolob6gk3kuyirfs@hjp.at> <87E125A5-A4B8-4BD6-9E9C-7ABF77650F3F@yugabyte.com> <20220928011353.zo7enlnig5vvpowe@jrouhaud> <5B23D9B8-56E8-458F-AD3D-B5F88AAB2844@yugabyte.com> <20220928200317.2ntj7ejvysjje55a@hjp.at>
* 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