Hiding a GUC from SQL

Поиск
Список
Период
Сортировка
От Michel Pelletier
Тема Hiding a GUC from SQL
Дата
Msg-id CACxu=vJhoXdtMKJR+Pc0T=4UknLYUKQzKJhwwBnJbemQwN1d0w@mail.gmail.com
обсуждение исходный текст
Ответы Re: Hiding a GUC from SQL
Re: Hiding a GUC from SQL
Список pgsql-general
In my extension pgsodium I'm defining a custom variable at startup to store a key:


I'm using the flags GUC_NO_SHOW_ALL | GUC_NO_RESET_ALL | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE, and a custom "no show" show hook that obscures the value.  This idea was inspired from the pgcryptokey module from Bruce Momjian.

The value cannot be shown either with SHOW or current_setting() and it does not appear in pg_settings.  From what I can tell, the value is inaccessible from SQL, but I think it's worth asking the experts if there is some other demonstrable way, from SQL, that this value could be leaked even to a superuser.  no sql level user should be able to see this value, only a C function, like the pgsodium_derive() from which to derive other keys, should be able to see it.  I realize that someone with external process access can get the key, my  goal is to prevent accessing it from SQL.

Any thoughts on weaknesses to this approach would be welcome.  Thanks!

-Michel

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: autovacuum failing on pg_largeobject and disk usage of the pg_largeobject growing unchecked
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Hiding a GUC from SQL