Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csvwb-0006jP-Ql for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Mar 2017 18:34:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1csvwb-0006V2-DA for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Mar 2017 18:34:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1csvwZ-0006SW-19 for pgsql-hackers@postgresql.org; Tue, 28 Mar 2017 18:34:11 +0000 Received: from mail-qk0-x22c.google.com ([2607:f8b0:400d:c09::22c]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1csvwV-0003It-RA for pgsql-hackers@postgresql.org; Tue, 28 Mar 2017 18:34:10 +0000 Received: by mail-qk0-x22c.google.com with SMTP id p22so73474531qka.3 for ; Tue, 28 Mar 2017 11:34:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=RO4ZY2SAUn5FxLOnvCMeSi/GL5QZzqdBdBk0vC4kzQQ=; b=p0kGVEzbA3dtTiO194JREeBEukCpvPEYePUn2QVMQq4PH1TFMZkOTUdNxpfSAgQaJf khp8K3h+BroVUIsIAC1cEboUvuiA9q78eTz0ObCr+cbTI2KaWmV3Sec356/yXQ6RtOkY uMcu+UfcykhLWMWpZgfcK3HjBaqkBs+zytg9VCg4cNJCUX4mw6G+WqQV7beVuMFxbqmh ACaOjwaJElq5LPbDbTwTA/3X/wNDCdXZSCTG3heUxqDoo21uqAEGTguQ1W41Q8GJpRCo lACuapR3BJzUnhzpWdCK96qgWPe9jhRpXSS9czKSHvtpKapH/f/rmY58sZcBNgEOejuC aewA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=RO4ZY2SAUn5FxLOnvCMeSi/GL5QZzqdBdBk0vC4kzQQ=; b=piDAkGpayMsD1t26BGIRYieN91U50tlxHc5Tl848IDS2wZWSW6Vf29DY8X967Swztw 16tWG7FmMxnit4ePmge1w2gc2CkSyjrn3zpSSH3ELq96KcUoCzOUv1iEhXlvfc+zzV1y fUwqx/OyyAAAxm4c2PBBC7Fik7RA32J75kjOSZk9paRODTZ1c+OZEQWt91R3EwZPFXgd rBNqZ5H/naiMcYtUbp05STNyyBfMR0OGwjnCdGeQ+PMV1j27C7vQGagUDHkGoiUnphQT UkytI8hRhh9ChFZXjgG6wmNgorgqayfwINhHKkkSomGk/5jN7oOjBD8ZMZaT69aA2SBd IEbQ== X-Gm-Message-State: AFeK/H2D90d2rpItBYf8o6k2ehgao6TT4h1/sM3inP/olIZSYgXUkPsnpEO7ah6/VOhk9Q== X-Received: by 10.55.132.3 with SMTP id g3mr24993706qkd.300.1490726046176; Tue, 28 Mar 2017 11:34:06 -0700 (PDT) Received: from [192.168.2.121] (24-113-198-113.wavecable.com. [24.113.198.113]) by smtp.gmail.com with ESMTPSA id r30sm3174263qtc.66.2017.03.28.11.34.04 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Mar 2017 11:34:05 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: Monitoring roles patch From: Mark Dilger In-Reply-To: <957FCA21-99DA-4477-9A6E-C86ACAC23E36@gmail.com> Date: Tue, 28 Mar 2017 11:34:03 -0700 Cc: Peter Eisentraut , Stephen Frost , Robert Haas , PostgreSQL Hackers Content-Transfer-Encoding: quoted-printable Message-Id: <7161672F-1EC5-478F-B307-FF28B01D0D62@gmail.com> References: <20170322131510.GC9812@tamriel.snowman.net> <20170323122335.GK9812@tamriel.snowman.net> <957FCA21-99DA-4477-9A6E-C86ACAC23E36@gmail.com> To: Dave Page X-Mailer: Apple Mail (2.3124) X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org > On Mar 28, 2017, at 11:06 AM, Mark Dilger wrote: >=20 >=20 >> On Mar 28, 2017, at 9:47 AM, Dave Page wrote: >>=20 >>> Does >>> pg_read_all_stats still have access to stats for mysecuretable? >>=20 >> Yes, because the ACL on the table controls reading/writing the data in >> the table. It doesn't have any bearing on any kind of table metadata. >> A user who has no privileges on a table can already look at (for >> example) pg_stat_all_tables and see the sort of info you're talking >> about. This patch would just allow members of a specific role get the >> on-disk size as well, *if* you choose to use it. >=20 > I don't entirely agree here. Security conscious database users may well > restrict access to that view. I added a check to the regression tests to > verify that it works: >=20 > + SET ROLE regress_locktable_user; > + SELECT COUNT(*) FROM pg_stat_all_tables; > + count=20 > + ------- > + 290 > + (1 row) > +=20 > + RESET ROLE; > + REVOKE ALL PRIVILEGES ON pg_stat_all_tables FROM PUBLIC; > + SET ROLE regress_locktable_user; > + SELECT COUNT(*) FROM pg_stat_all_tables; > + ERROR: permission denied for relation pg_stat_all_tables > + RESET ROLE; > + SELECT COUNT(*) FROM pg_stat_all_tables; > + count=20 > + ------- > + 292 > + (1 row) > +=20 >=20 > The inability to revoke access to this sort of information being proposed > makes me a bit uneasy. Mostly, I think, I'm bothered because there may > be people who have revoked privileges on a lot of things, thereby restric= ting > access to superuser, who won't necessarily notice this new feature in > postgres 10. That could be a source of security holes that we get blamed > for. After a bit of introspection, I think what is really bothering me is not the inability to revoke permissions, since as you say I can choose to not assign the role to anybody. What bothers me is that this feature implicitly redef= ines what is meant by the keyword PUBLIC. If I go around the database revoking privileges on everything from PUBLIC, I should end up with a database that is inaccessible to anyone but superuser, right? All views, functions, tables, etc., would all be locked down. But after this proposed change, IIUC, there would still be a bit of access available to this/these proposed non-superuser role(s) which have hardcoded permissions. That's quite a significant change to the security model of the database, and I don't think it is something users would expect from the release notes if the release notes for this feature say something like: "added database monitoring functionality" To be fair, I have not tried to revoke everything from everybody on a database to verify that their aren't already problems of this sort. Perhaps the cows have already left the barn. mark --=20 Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers