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 1mxYr2-0005DO-Qw for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Dec 2021 18:18:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mxYr1-0007cf-MS for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Dec 2021 18:18:15 +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 1mxYr1-0007c5-1o for pgsql-hackers@lists.postgresql.org; Wed, 15 Dec 2021 18:18:15 +0000 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mxYqv-0001bf-K3 for pgsql-hackers@postgresql.org; Wed, 15 Dec 2021 18:18:14 +0000 Received: by mail-pj1-x1035.google.com with SMTP id k6-20020a17090a7f0600b001ad9d73b20bso20028057pjl.3 for ; Wed, 15 Dec 2021 10:18:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=zszY5qlmO2TJJB2JzFjlodkBVEwnBn8ZYsFdluSxmNc=; b=hcwwPToRjbSwUsoBKWJ+a5AZp6+jM0uVyXaxD3OLo8YgX/CuADLx9q4LtywzuymrFZ 7ipg2i3+OITGf6RlU+nFNl3XPxfapXFT8TqFcPNfAIu/lGoqNdufOtxdnvJPn4iUJd+o SaRFYdjPoJlEmOa5ZDbHJvZN4itmgO7E/2Cx9eusysEOUB/WoTCgs2bQKgBsDWHnHevl bsqfui7GRb0BRihxj9Zt4r9fmMQn/1YnnKgyu584GuQ8n3+QP37rdDD8jNkapMKjnaI6 Tmvsro3LWF4uQj0u0wdVICNT4g6njl+WWmaqFTVh6eQjbdLPz6TwIhsN4Njk6msUIBPI omrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=zszY5qlmO2TJJB2JzFjlodkBVEwnBn8ZYsFdluSxmNc=; b=iuhAL65LMgY5RAfEooY/wY8q4byN3VxjyiI8VY3wfmOAhuVMeAddfsBoaE1yWvar6p GaQ7yulegmMKaufr//UYo9groqy8Zu9HLip8sX33nlJezluDd/s0fkaH/3KP+DzO2Nqq sFtamYCkoL05/qm1l06BG+xe9UG4YPQpBHys7xg5uWPtpCtQi5PYYFbJpGnWrXLBKb7R NgW0YieIcXbr/+sp9GhfAFO6RpiSCzjkOcjLIVQZFR8A9H335CnLowXR98aFGM5X+eEk 7SZ+Jh9k8mq+WqLSlt/iT8yHZIqMGbNafT5CwceJycekiDHMNBy9rFpugT025fPHF9Kz KeRQ== X-Gm-Message-State: AOAM530iz0xEjIvjiOOkZIMMSa7RwlMmRPBWwBhJde4xaJZYWgH6kBrB JVh3PJRCmnWluLUKM9F7SHkNTNgyahNjO98k3wYykuuLEzPw3CX9QxHxENTmjLoR1/f7+2jshO2 XM8JPIrvfFdX1GFC0sdlFZJrJSXJu1z4ZREP66PVx1B8PRW13u43tRZw6N6n5Ym/vdjExcQzGvO 8GzP5A3vSEMYonUGFvcIJ67XYxzsS1HoRY9fEv X-Google-Smtp-Source: ABdhPJySpxNNvMKK0n7QBTG+b6BarunXXAGn14ie8THJAcsrmoXTY7Wxe7adk+rVPsqYjm1ojKpRsg== X-Received: by 2002:a17:90a:b382:: with SMTP id e2mr1095550pjr.181.1639592287178; Wed, 15 Dec 2021 10:18:07 -0800 (PST) Received: from laptop280-ma-us.hitronhub.home (24-113-193-150.wavecable.com. [24.113.193.150]) by smtp.gmail.com with ESMTPSA id q21sm3254677pfu.106.2021.12.15.10.18.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Dec 2021 10:18:06 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: Granting SET and ALTER SYSTE privileges for GUCs From: Mark Dilger In-Reply-To: Date: Wed, 15 Dec 2021 10:18:05 -0800 Cc: Andrew Dunstan , Robert Haas , Jeff Davis , PostgreSQL-development , Tom Lane , Joe Conway Content-Transfer-Encoding: quoted-printable Message-Id: References: <3D691E20-C1D5-4B80-8BA5-6BEB63AF3029@enterprisedb.com> <9DB8DABC-0E1E-4AB0-BB11-9BC48E4C71BE@enterprisedb.com> <2D6C1081-DB7D-4260-8987-5B4912E95917@enterprisedb.com> To: Joshua Brindle X-Mailer: Apple Mail (2.3608.120.23.2.7) X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Dec 15, 2021, at 10:02 AM, Joshua Brindle = wrote: >=20 > Ah, I was actually requesting a hook where the acl check was done for > setting a GUC, such that we could deny setting them in a hook, > something that would be useful for the set_user extension > (github.com/pgaudit/set_user) Hmm, this seems orthogonal to the patch under discussion. This patch = only adds a pg_setting_acl_aclcheck in ExecSetVariableStmt() for = settings which have been explicitly granted, otherwise it works the = traditional way (checking whether the setting is suset/userset). I = don't think you'd get MAC support without finding a way to fire the hook = for all settings, regardless of their presence in the new pg_setting_acl = table. That is hard, because InvokeObjectPostAlterHook expects the = classId (SettingAclRelationId) and the objectId (pg_setting_acl.oid), = but you don't have those for many (most?) settings. As discussed = upthread, we *do not* want to force an entry into the table for all = settings, only for ones that have been explicitly granted. Do you agree? I'm happy to support MAC in this patch if can explain a = simple way of doing so. > but having a hook for grant/revoke is > also helpful. Yes, I see no reason to rip this out. =E2=80=94 Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company