Re: Cross-backend signals and administration (Was: Re: pg_terminate_backend for same-role)

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)postgresql(dot)org, Magnus Hagander <magnus(at)hagander(dot)net>, Daniel Farina <daniel(at)heroku(dot)com>, Noah Misch <noah(at)leadboat(dot)com>
Subject: Re: Cross-backend signals and administration (Was: Re: pg_terminate_backend for same-role)
Date: 2012-03-28 14:20:34
Message-ID: CA+TgmobErSGqa1KEvgC-1doZYHCRr=6s=c_21-UJ5cPV7aHVSQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 28, 2012 at 10:02 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:
>> Andres Freund <andres(at)anarazel(dot)de> wrote:
>>> On Tuesday, March 27, 2012 07:51:59 PM Kevin Grittner wrote:
>>>> As Tom pointed out, if there's another person sharing the user ID
>>>> you're using, and you don't trust them, their ability to cancel
>>>> your session is likely way down the list of concerns you should
>>>> have.
>
>>> Hm. I don't think that is an entirely valid argumentation. The
>>> same user could have entirely different databases. They even could
>>> have distinct access countrol via the clients ip.
>>> I have seen the same cluster being used for prod/test instances at
>>> smaller shops several times.
>>>
>>> Whether thats a valid usecase I have no idea.
>
>> Well, that does sort of leave an arguable vulnerability.  Should the
>> same user only be allowed to kill the process from a connection to
>> the same database?
>
> I don't see a lot of merit in this argument either.  If joeseviltwin
> can connect as joe to database A, he can also connect as joe to
> database B in the same cluster, and then do whatever damage he wants.
>
> Fundamentally, if two users are sharing the same userid, *they are the
> same user* as far as Postgres is concerned.  It's just silly to make
> protection decisions on the assumption that they might not be.
> If a DBA does not like the consequences of that, the solution is
> obvious.

I'm coming around to the point of view that we should just make
pg_terminate_backend()'s behavior consistent with pg_cancel_backend()
and call it good.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-03-28 14:23:08 Re: Publish checkpoint timing and sync files summary data to pg_stat_bgwriter
Previous Message Tom Lane 2012-03-28 14:20:10 Re: 9.2 commitfest closure (was Command Triggers, v16)