Re: Security Issues: Allowing Clients to Execute SQL in the Backend.

Поиск
Список
Период
Сортировка
От Rory Campbell-Lange
Тема Re: Security Issues: Allowing Clients to Execute SQL in the Backend.
Дата
Msg-id 20140430080800.GA14534@campbell-lange.net
обсуждение исходный текст
Ответ на Security Issues: Allowing Clients to Execute SQL in the Backend.  (Hello World <worldanizer@gmail.com>)
Список pgsql-general
On 30/04/14, Hello World (worldanizer@gmail.com) wrote:
> I'm developing a web application that needs to display data from a postgres
> backend.
>
> The most convenient way for the app to get the data is by expressing the
> request in SQL.
>
> I'm thinking about the following architecture
>
> [ App/Client ] -----> query in SQL ---> [Web server] ---> same SQL query
> --> [PG database]
...
> Given this are there any security other issues about letting client
> applications execute arbitrary SQL commands on the backend database?

If you wrap your queries into plpgsql functions you can provide a
managed interface to clients using Postgres security which provide calls
which are unlikely to badly affect server performance. For instance you
can not only control the complexity of the query performed but also fix
hard limits such as the number of rows returned. This approach partly
meets your criteria of allowing SQL commands from client apps, but not
arbitrary ones.

--
Rory Campbell-Lange


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

Предыдущее
От: Willy-Bas Loos
Дата:
Сообщение: importing a messy text file
Следующее
От: Karsten Hilbert
Дата:
Сообщение: Re: importing a messy text file