From: | Sim Zacks <sim(at)compulab(dot)co(dot)il> |
---|---|
To: | PostgreSQL general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Why security-definer functions are executable by public by default? |
Date: | 2011-04-05 07:45:56 |
Message-ID: | 4D9AC8B4.4000406@compulab.co.il |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 04/05/2011 09:41 AM, hubert depesz lubaczewski wrote:
> hi
>
> was pointed to the fact that security definer functions have the same
> default privileges as normal functions in the same language - i.e. if
> the language is trusted - public has the right to execute them.
>
> maybe i'm missing something important, but given the fact that security
> definer functions are used to get access to things that you usually
> don't have access to - shouldn't the privilege be revoked by default,
> and grants left for dba to decide?
>
> depesz
That is exactly the point of security definer. It means that even though
you do not have rights to data, I have a special function that will
allow you the rights in a very specific way.
For example, I give my users no rights on any tables. The only way they
can access data is through views and security definer functions. The
functions are built in such a way that it only allows them access in the
manner that I want them to.
So while my user cannot insert into the table, he can pass the correct
parameters into the function and if everything checks out write it will
insert the row.
Sim
From | Date | Subject | |
---|---|---|---|
Next Message | Nick Raj | 2011-04-05 08:04:46 | Integrating New Data Type |
Previous Message | hubert depesz lubaczewski | 2011-04-05 06:41:21 | Why security-definer functions are executable by public by default? |