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 1o4ijW-00050o-8b for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Jun 2022 12:48:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o4ijU-0003MV-Q5 for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Jun 2022 12:48:20 +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 1o4ijU-0003MM-5F for pgsql-hackers@lists.postgresql.org; Fri, 24 Jun 2022 12:48:20 +0000 Received: from smtp-fw-80007.amazon.com ([99.78.197.218]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o4ijQ-0005mM-A7 for pgsql-hackers@lists.postgresql.org; Fri, 24 Jun 2022 12:48:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1656074896; x=1687610896; h=message-id:date:mime-version:subject:from:to:cc: references:in-reply-to:content-transfer-encoding; bh=5X3ND0yraSCV7c/fM7bs8ZrsQ5Y/ehaOq0nrsuS9SaY=; b=St463ujmgnuRV1BHlF8lOuEJKRAEUEWLW4Xt5qiaKN8wxAoBEbFESbXh K1VZUoy3cUXZBw27Zc/EBC78klkWBNuU6Fm1BqP/+GY28XQCHjxjCcv0R +mDWK7aEOHhGTRjJygqqVsQTEqW37aY7jaGP7xUBapSQNkw5z5FuCoO4y U=; X-IronPort-AV: E=Sophos;i="5.92,218,1650931200"; d="scan'208";a="101601543" Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO email-inbound-relay-pdx-2c-7d0c7241.us-west-2.amazon.com) ([10.25.36.210]) by smtp-border-fw-80007.pdx80.corp.amazon.com with ESMTP; 24 Jun 2022 12:47:58 +0000 Received: from EX13D03EUC003.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198]) by email-inbound-relay-pdx-2c-7d0c7241.us-west-2.amazon.com (Postfix) with ESMTPS id B82F542AB0; Fri, 24 Jun 2022 12:47:57 +0000 (UTC) Received: from [192.168.5.45] (10.43.160.26) by EX13D03EUC003.ant.amazon.com (10.43.164.192) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Fri, 24 Jun 2022 12:47:54 +0000 Message-ID: Date: Fri, 24 Jun 2022 14:47:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: SYSTEM_USER reserved word implementation Content-Language: en-US From: "Drouvot, Bertrand" To: Jacob Champion , Joe Conway , Tom Lane CC: PostgreSQL Hackers References: <7e692b8c-0b11-45db-1cad-3afc5b57409f@amazon.com> <3338921.1655905757@sss.pgh.pa.us> <28b4a9ef-5103-f117-99e1-99ae5a86a6e8@joeconway.com> <3361134.1655909496@sss.pgh.pa.us> <89d0577e-b9f8-4d8a-224d-b336a5fe08af@joeconway.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.43.160.26] X-ClientProxiedBy: EX13D41UWC003.ant.amazon.com (10.43.162.30) To EX13D03EUC003.ant.amazon.com (10.43.164.192) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/24/22 11:49 AM, Drouvot, Bertrand wrote: > Hi, > > On 6/23/22 10:06 AM, Drouvot, Bertrand wrote: >> Hi, >> >> On 6/22/22 5:35 PM, Jacob Champion wrote: >>> On Wed, Jun 22, 2022 at 8:10 AM Joe Conway wrote: >>>> On the contrary, I would argue that not having the identifier for the >>>> external "user" available is a security concern. Ideally you want >>>> to be >>>> able to trace actions inside Postgres to the actual user that >>>> invoked them. >>> If auditing is also the use case for SYSTEM_USER, you'll probably want >>> to review the arguments for making it available to parallel workers >>> that were made in the other thread [1]. >> >> Thanks Jacob for your feedback. >> >> I did some testing initially around the parallel workers and did not >> see any issues at that time. >> >> I just had another look and I agree that the parallel workers case >> needs to be addressed. >> >> I'll have a closer look to what you have done in [1]. >> >> Thanks >> >> Bertrand >> > Please find attached patch version 2. > > It does contain: > > - Tom's idea implementation (aka presenting the system_user as > auth_method:authn_id) > > - A fix for the parallel workers issue mentioned by Jacob. The patch > now propagates the SYSTEM_USER to the parallel workers. > > - Doc updates > > - Tap tests (some of them are coming from [1]) > > Looking forward to your feedback, > > Thanks > > Bertrand FWIW here is a link to the commitfest entry: https://commitfest.postgresql.org/38/3703/ Bertrand