Re: Non-superuser subscription owners

Поиск
Список
Период
Сортировка
От Mark Dilger
Тема Re: Non-superuser subscription owners
Дата
Msg-id 89D3BC62-6CFE-4918-8F52-FC53C2AB8389@enterprisedb.com
обсуждение исходный текст
Ответ на Re: Non-superuser subscription owners  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Non-superuser subscription owners  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers

> On Feb 1, 2023, at 6:43 AM, Robert Haas <robertmhaas@gmail.com> wrote:

> The thing I'm
> struggling to understand is: if you only want to replicate into tables
> that Alice can write, why not just make Alice own the subscription?
> For a run-as user to make sense, you need a scenario where we want the
> replication to target only tables that Alice can touch, but we also
> don't want Alice herself to be able to touch the subscription, so you
> make Alice the run-as user and yourself the owner, or something like
> that. But I'm not sure what that scenario is exactly.

This "run-as" idea came about because we didn't want arbitrary roles to be able to change the subscription's connection
string. A competing idea was to have a server object rather than a string, with roles like Alice being able to use the
serverobject if they have been granted usage privilege, and not otherwise.  So the "run-as" and "server" ideas were
somewhatcompeting. 

> Mark was postulating a scenario where the publisher and subscriber
> don't trust each other. I was thinking a little bit more about that. I
> still maintain that the current system is poorly set up to make that
> work, but suppose we wanted to do better. We could add filtering on
> the subscriber side, like you list schemas or specific relations that
> you are or are not willing to replicate into. Then you could, for
> example, connect your subscription to a certain remote publication,
> but with the restriction that you're only willing to replicate into
> the "headquarters" schema. Then we'll replicate whatever tables they
> send us, but if the dorks at headquarters mess up the publications on
> their end (intentionally or otherwise) and add some tables from the
> "locally_controlled_stuff" schema, we'll refuse to replicate that into
> our eponymous schema.

That example is good, though I don't see how "filters" are better than roles+privileges.  Care to elaborate?

—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company






В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Weird failure with latches in curculio on v15
Следующее
От: Tom Lane
Дата:
Сообщение: Re: MacOS: xsltproc fails with "warning: failed to load external entity"