Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oXy31-0000DN-30 for pgsql-general@arkaria.postgresql.org; Tue, 13 Sep 2022 05:01:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oXy2z-0006DR-IL for pgsql-general@arkaria.postgresql.org; Tue, 13 Sep 2022 05:01:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oXy2z-0006DI-7E for pgsql-general@lists.postgresql.org; Tue, 13 Sep 2022 05:01:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oXy2x-0007tj-33 for pgsql-general@lists.postgresql.org; Tue, 13 Sep 2022 05:01:20 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 28D51GHa1886399; Tue, 13 Sep 2022 01:01:16 -0400 From: Tom Lane To: Bryn Llewellyn cc: Christophe Pettus , pgsql-general list , "David G. Johnston" Subject: Re: Is it possible to stop sessions killing eachother when they all authorize as the same role? In-reply-to: References: <10F360BB-3149-45E6-BFFE-10B9AE31F1A6@yugabyte.com> Comments: In-reply-to Bryn Llewellyn message dated "Mon, 12 Sep 2022 21:02:57 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1886397.1663045276.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 13 Sep 2022 01:01:16 -0400 Message-ID: <1886398.1663045276@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Bryn Llewellyn writes: > I can't agree with you about risks and probability, though. The general = literature of security threats often makes the point that disgruntled empl= oyees (current or very recently former) who know the code in question do s= ometimes wreak havoc=E2=80=94sometimes just for sport. The general risk th= at the unrestricted ability to use "pg_terminate_backend()" to kill sessio= ns started by one's peers is ordinary denial of service=E2=80=94notwithsta= nding the possibility for automatic re-connect. It still steals time and r= esources. I'm not sure that this argument has much to recommend it. If you are able to issue arbitrary SQL commands, you can cause effective denials-of-service in many ways. A couple of random examples: * launch a query that will eat indefinite amounts of CPU and/or disk. * "LOCK TABLE some-important-table" and leave for lunch. * leave a transaction open and go on vacation. Yeah, you can progressively lock down a system against all of these sorts of hazards, but it will get progressively less useful for anyone who wants to do actual work on it. In the end, the default settings have to represent a compromise that we think is generally useful. You're welcome to lock your own installation down more than that, but it doesn't follow that everybody else should too. regards, tom lane