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 1ntsGT-0008G4-7N for pgsql-general@arkaria.postgresql.org; Wed, 25 May 2022 14:45:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ntsGS-0001WX-3q for pgsql-general@arkaria.postgresql.org; Wed, 25 May 2022 14:45:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntsGR-0001WI-Ok for pgsql-general@lists.postgresql.org; Wed, 25 May 2022 14:45:31 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ntsGP-0000US-50 for pgsql-general@lists.postgresql.org; Wed, 25 May 2022 14:45:30 +0000 Received: by mail-pl1-x634.google.com with SMTP id f18so853020plg.0 for ; Wed, 25 May 2022 07:45:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to; bh=xmioXLsrZjd1NPJR9u2GgMwxBXbH3WV8du8Jyoxt9+0=; b=JmPKNO2clwOXpDD6zfcaueHhrdc2806Oj4ThOewZeZgvmd88OoNbyhgTIAiRPZU3Lu QiYhvp9s3i2rkjRwN6rfDFI7ukM4vjyTmMIptWQzrszg62FEIfgd9KeJ3/mVKUc8buC+ 4OqCrVnqh9AdnnnIGdKkVFVbJ+mckuEBRl4fct13FAU3Ir1XBNr0NEvq4+REKZz1VC0D mCkpzWhY8nVFtKHrprzx5l1/CxkUX7OU++tXk5xNBlpIV+2huTqq3x0yrWLx2NDoZ5aM u/A7zY2HKz7lyZGalT2gTIF0ih0JdFaN2R61inpuAwVPt9f6eJPcaygmMv17ixqhILNp r4IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to; bh=xmioXLsrZjd1NPJR9u2GgMwxBXbH3WV8du8Jyoxt9+0=; b=VIx6XcmBhc69akfAJOwuR6ddtgYNh8vzZBfspWbOCDcE3sW4LlyOtJ2GpGgEWU0+zK wVYKiLnfg057+4xFDoSU+gf4GKKMyhhszXDVV+GeE25jyD5MevRhtgtctMUHGYtRGn3l rkBCenuQ0ts3ZGKn7LnfEPXQ67x3W2CrFONeUJCjLUkqi5yct/7R1Fc3lgWYcnaTaAc1 ltDK2SdFm2kGZ5jaE9YJgO97qCsGJPIJa+uJijrf6mBHdAPhpYHdsBusr9pFy/xwy7xH Ahkl7kERMqjOw4QFrlMzNm3/C0012SQJFlyku1s4qwAchqrUiY+mKVyEUQEv6oRvwy76 Z73Q== X-Gm-Message-State: AOAM532ABbM+PDcV5CR6aETVD7H8wuvgDCbZ1vDXZFzJo8ok+vGpYR5s J4SubYYUTMUhnf8KGBwCdFo0h684WfU= X-Google-Smtp-Source: ABdhPJyI7CNAdU4rnvRJQv0fHnlEH3tvqAAlLvd8MaLV1lNdeyJcrOK4wadqQnKPj4iVsbSurj9btA== X-Received: by 2002:a17:902:d5c1:b0:162:64e:8c21 with SMTP id g1-20020a170902d5c100b00162064e8c21mr21590167plh.34.1653489928178; Wed, 25 May 2022 07:45:28 -0700 (PDT) Received: from [10.128.71.194] ([155.98.131.2]) by smtp.gmail.com with ESMTPSA id t2-20020a170902bc4200b0015e8d4eb1ffsm38924plz.73.2022.05.25.07.45.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 May 2022 07:45:27 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------M02h1FL1owjjHedBndc6NiHT" Message-ID: <780bcde5-f068-abfe-89d7-cf7631bb36ba@gmail.com> Date: Wed, 25 May 2022 08:45:26 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: connect permission based on database name Content-Language: en-CA To: "David G. Johnston" Cc: Tom Lane , "pgsql-generallists.postgresql.org" References: <3659d499-9a98-6362-7c33-d8f2947474b4@gmail.com> <1920549.1653488423@sss.pgh.pa.us> From: Rob Sargent In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------M02h1FL1owjjHedBndc6NiHT Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 5/25/22 08:44, David G. Johnston wrote: > On Wednesday, May 25, 2022, Rob Sargent wrote: > > On 5/25/22 08:20, Tom Lane wrote: >> Rob Sargent writes: >>> Just wondering if I've bumped into some security issue. >>> I'm somewhat surprised that "grant connect to database   to >>> " appears to be stored "by name"? >> I think you are forgetting that databases have a default GRANT CONNECT >> TO PUBLIC. You need to revoke that before other grants/revokes will >> have any functional effect. >> >> regards, tom lane > And then the search path is "just a string"? > > > > Search_path isn’t a security component and accepts, but ignores, > unknown names.  So yes, it is just a string. > > David J. > Roger that, thanks. --------------M02h1FL1owjjHedBndc6NiHT Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 5/25/22 08:44, David G. Johnston wrote:
On Wednesday, May 25, 2022, Rob Sargent <robjsargent@gmail.com> wrote:
On 5/25/22 08:20, Tom Lane wrote:
Rob Sargent <robjsargent@gmail.com> writes:
Just wondering if I've bumped into some security issue.
I'm somewhat surprised that "grant connect to database <dbname>  to 
<role>" appears to be stored "by name"?
I think you are forgetting that databases have a default GRANT CONNECT
TO PUBLIC.  You need to revoke that before other grants/revokes will
have any functional effect.

			regards, tom lane
And then the search path is "just a string"?


Search_path isn’t a security component and accepts, but ignores, unknown names.  So yes, it is just a string.

David J.
 
Roger that, thanks.

--------------M02h1FL1owjjHedBndc6NiHT--