Re: Protect extension' internal tables - how?

Поиск
Список
Период
Сортировка
От Aleksander Alekseev
Тема Re: Protect extension' internal tables - how?
Дата
Msg-id CAJ7c6TOQVQRLjrEqZXwKTNQH_UkYt0fzXRr2w0vTQG5oEYGrHA@mail.gmail.com
обсуждение исходный текст
Ответ на Protect extension' internal tables - how?  (Nikita Malakhov <hukutoc@gmail.com>)
Ответы Re: Protect extension' internal tables - how?
Список pgsql-hackers
Hi,

> Could you please advise or give some hint on what is the correct (and
> secure) way to implement this?
>
> Currently I use the owner of the extension as owner when creating
> such a table inside the function, but maybe there are some pitfalls
> in this kind of solution?

If the goal is to protect the user from an _accidental_ access to the
tables, placing them into a separate schema _my_extension_private or
something will be enough.

Otherwise consider using corresponding access control abilities of
PostgreSQL and creating functions with SECURITY DEFINER [1]. Be
mindful that your functions will become a target for privilege
escalation, so you should be extra careful with the implementation.

[1]: https://www.postgresql.org/docs/current/sql-createfunction.html

-- 
Best regards,
Aleksander Alekseev



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

Предыдущее
От: Aleksander Alekseev
Дата:
Сообщение: Re: ObjectIdGetDatum() missing from SearchSysCache*() callers
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: [PoC] pg_upgrade: allow to upgrade publisher node