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 1o7Ffs-0001O2-Du for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Jul 2022 12:23:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o7Ffq-0004qF-4u for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Jul 2022 12:23:02 +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 1o7Ffp-0004q3-Ij for pgsql-hackers@lists.postgresql.org; Fri, 01 Jul 2022 12:23:01 +0000 Received: from mail-vs1-xe2f.google.com ([2607:f8b0:4864:20::e2f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o7Ffm-0006Is-2T for pgsql-hackers@postgresql.org; Fri, 01 Jul 2022 12:23:00 +0000 Received: by mail-vs1-xe2f.google.com with SMTP id o190so2179618vsc.5 for ; Fri, 01 Jul 2022 05:22:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joeconway.com; s=google; h=message-id:date:mime-version:user-agent:content-language:to:cc :references:from:subject:in-reply-to:content-transfer-encoding; bh=J53XACajeCmrg44KpD5yjZByoV4YSzdUAOkvBcA2SAM=; b=b7C9u8wlED/LzZDTj2cURDux8jm1BHdNQUC2nxl/MPHAeWiVfmeRsD98f6xO0c1KRi mMaObPCaBg/ldFsUEU9VQ4vMRMSe+EO27fvJvcR7xZzYxeF+wda5rPl8/VK7UMlueWUJ 0PPsBFFTV+pgxVNfu6v3KvNh9dcvzF75gQkZak38wgZS0ePvHMlXCku63JhpMCzQLK9o BneA+DREpLU8oMvkHoHSxiRWHW0CNea03afNVmDBSYv/zduzeZzop1/Scy6kXBOi/qT2 XJieU579+5a+sd9zHs16SeWq0Cz8JE2jJyilpRnk/nLxQYd9rGIQA5VFZ/Pv5QHpXJOq Vn7Q== 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 :content-language:to:cc:references:from:subject:in-reply-to :content-transfer-encoding; bh=J53XACajeCmrg44KpD5yjZByoV4YSzdUAOkvBcA2SAM=; b=XCgiKjf8D16kAVK17AOa/IRAAW3gfEj5s6gFplcQUPwh6ZwS7shK0FfZ8kgIy/qhqH qtVMbWcXCqp33ulvxq0OoUSOvkVBMbffBAc1m1lmfLX9irzcvHrKsZQwU3UWioHjVN2o UEBDTO1eVegB0Gx+bC72SLQk5WsAY76Dzt9zUhiHncW5pDfmyCVSPMazn/5WkZ6J2sS9 /pWDd2TxZE9kOmeLsG1bCWwI/rkx5pcmajTzNXRKIa6cmO5fctvpL4lQSqMS6b+KugV7 KpiiD4l9qTWq4LDMS4RDpa+zP90aq0Ms3RcrjUkDWL+CLueqrHFUZM5yaZ353ZvXIlVI 77HQ== X-Gm-Message-State: AJIora85jMAziHwscPOfxveQZokkPs8aq1C2bR23Y1vjTN7F/BKZBfZr 3q9q7Gt6K6KYkQVXWliLGOf1yQ== X-Google-Smtp-Source: AGRyM1vdDWfY9CMaO4KMskKIRku6vF4v4/bFiVHlmx4C+stmI5QqLrY9X9dHsNERdieskYntX3rasA== X-Received: by 2002:a67:df96:0:b0:354:3322:3ad9 with SMTP id x22-20020a67df96000000b0035433223ad9mr11162279vsk.68.1656678175764; Fri, 01 Jul 2022 05:22:55 -0700 (PDT) Received: from [192.168.4.41] (072-017-018-098.res.spectrum.com. [72.17.18.98]) by smtp.gmail.com with ESMTPSA id d73-20020a1f1d4c000000b0036cf73a1e99sm2617496vkd.39.2022.07.01.05.22.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Jul 2022 05:22:55 -0700 (PDT) Message-ID: <442d7887-645d-0e31-e971-7a8dc8952d2f@joeconway.com> Date: Fri, 1 Jul 2022 08:22:53 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Content-Language: en-US To: Robert Haas Cc: Nathan Bossart , Tom Lane , "Bossart, Nathan" , Stephen Frost , PostgreSQL-development References: <730520.1644168290@sss.pgh.pa.us> <80af9ba7-ec24-9134-8fd9-00bf13f5c494@joeconway.com> <1066202.1654190251@sss.pgh.pa.us> <20220629231939.GA362451@nathanxps13> <20220630232931.GA367181@nathanxps13> <20220701025830.GA369935@nathanxps13> <12e2f0cb-08ff-c65f-d31e-76cea1af70ec@joeconway.com> From: Joe Conway Subject: Re: replacing role-level NOINHERIT with a grant-level option In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 7/1/22 07:48, Robert Haas wrote: > On Fri, Jul 1, 2022 at 6:17 AM Joe Conway wrote: >> Would this allow for an explicit REVOKE to override a default INHERIT >> along a specific path? > > Can you give an example? > > If you mean that A is granted to B which is granted to C which is > granted to D and you now want NOINHERIT behavior for the B->C link in > the chain, this would allow that. You could modify the existing grant > by saying either "REVOKE INHERIT OPTION FOR B FROM C" or "GRANT B TO C > WITH INHERIT FALSE". Hmm, maybe I am misunderstanding something, but what I mean is something like: 8<---------------- CREATE TABLE t1(f1 int); CREATE TABLE t2(f1 int); CREATE USER A; --defaults to INHERIT CREATE USER B; CREATE USER C; GRANT select ON TABLE t1 TO B; GRANT select ON TABLE t2 TO C; GRANT B TO A; GRANT C TO A; SET SESSION AUTHORIZATION A; -- works SELECT * FROM t1; -- works SELECT * FROM t2; RESET SESSION AUTHORIZATION; REVOKE INHERIT OPTION FOR C FROM A; SET SESSION AUTHORIZATION A; -- works SELECT * FROM t1; -- fails SELECT * FROM t2; 8<---------------- So now A has implicit inherited privs for t1 but not for t2. -- Joe Conway RDS Open Source Databases Amazon Web Services: https://aws.amazon.com