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 1ntrzG-0007cF-Ro for pgsql-general@arkaria.postgresql.org; Wed, 25 May 2022 14:27:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ntrzF-000234-Ok for pgsql-general@arkaria.postgresql.org; Wed, 25 May 2022 14:27:45 +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 1ntrzF-00022v-Cg for pgsql-general@lists.postgresql.org; Wed, 25 May 2022 14:27:45 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ntrz8-0000JE-UD for pgsql-general@lists.postgresql.org; Wed, 25 May 2022 14:27:44 +0000 Received: by mail-pf1-x432.google.com with SMTP id x143so19354801pfc.11 for ; Wed, 25 May 2022 07:27:38 -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=lyb+W0dCGu5++Lepp/8GLCK3fXYsqo07C3radHNhyCs=; b=nURvg7GSWxf1VoiCam59+0TXwV89T4pH82/HHLGsVL+9z1P4yjBXDqaAfRq4yaTCO7 yD0aiCxcf/GW4vJkMDiPyP+pPKDFg48p2QwagmkZ4yVXeHrguGsaP+CJXiKozZ1ZnwM9 uhFDPYM1yEnsBfUhaSHb59kg9QTAnCthsXLLiysTl3MgIfFeDFv9N90ydWxfI1KQy0yy pAVA9/iKjtmNqRgDnJc+dY929UTCersN5JJN98W8i4k2Pk8VJFNxfalIz0tOv0ECiw8O hBeHLK0KmogZzKmfyWCq5+g+yXyxRmiN/7s3M9gbbZ49jdFN66hl9ZHVxRNZ7BpYZ8Ff kfaQ== 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=lyb+W0dCGu5++Lepp/8GLCK3fXYsqo07C3radHNhyCs=; b=c61TBRv2WPZov1n+Ks9HN5MJXirLY/wtKypEDw0XexxrgBrd0Cbhj2uCmszVQ2Dblt Lf2Dv9gmr2YWxDnzqg9ysV/WJGuypeFPtmKlYClqAnsfKHhHepk9ogU0Rb3gxdeCQmKS Cd8vJEKuWdsya/JBR7K5w0ampXap7GvnskeHldmhhQKfTEuV1l0BdEOzBLlZYz14flwT sCY/wls0ojx5cUXJS9wStFygDcCu+OYISsoUc743qywgydMTsMjSJ6Qa+o46ym8ktZ70 AROlPHL6R2IhmAgv0xXoNQpXKEcxE4zNoI4qXEl+FWZPt06Yj8VgqGkXGbQMGC+3LagC qwnw== X-Gm-Message-State: AOAM532mW0nH7PojqP0N32Nqtt7nC8FnlvB644Dm97556pnG1X/pJ085 O6OvOXeRGgiUXVbsiX/s6S4= X-Google-Smtp-Source: ABdhPJz6WL561YaUw9ZSILUoe4ZTQA2K2BtasK1/wMrqa5+HCFjSB4fiLmGQDOZgfxqCs5RJCf+5VQ== X-Received: by 2002:a63:189:0:b0:3fa:ab5:4218 with SMTP id 131-20020a630189000000b003fa0ab54218mr16693283pgb.91.1653488857925; Wed, 25 May 2022 07:27:37 -0700 (PDT) Received: from [10.128.71.194] ([155.98.131.2]) by smtp.gmail.com with ESMTPSA id f16-20020a056a0022d000b0050dc76281dfsm5119605pfj.185.2022.05.25.07.27.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 May 2022 07:27:37 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------hzZKnZgPqjzI7xFKrFR0THsF" Message-ID: <574d44d9-1900-75e3-7c01-e93c5a92ea0c@gmail.com> Date: Wed, 25 May 2022 08:27:35 -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: Tom Lane Cc: "pgsql-generallists.postgresql.org" References: <3659d499-9a98-6362-7c33-d8f2947474b4@gmail.com> <1920549.1653488423@sss.pgh.pa.us> From: Rob Sargent In-Reply-To: <1920549.1653488423@sss.pgh.pa.us> 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. --------------hzZKnZgPqjzI7xFKrFR0THsF Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 Yes, of course.  Thanks --------------hzZKnZgPqjzI7xFKrFR0THsF Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
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
Yes, of course.  Thanks
--------------hzZKnZgPqjzI7xFKrFR0THsF--