Re: Non-superuser subscription owners
Jacob Champion <jchampion@timescale.com>
From: Jacob Champion <jchampion@timescale.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Andres Freund <andres@anarazel.de>,
Mark Dilger <mark.dilger@enterprisedb.com>, Jeff Davis <pgsql@j-davis.com>, Amit Kapila <amit.kapila16@gmail.com>, Andrew Dunstan <andrew@dunslane.net>,
PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2023-01-23T18:27:27Z
Lists: pgsql-hackers
On Mon, Jan 23, 2023 at 8:35 AM Robert Haas <robertmhaas@gmail.com> wrote: > I will admit that this is not an open-and-shut case, because a > passwordless login back to the bootstrap superuser account from the > local machine is a pretty common scenario and doesn't feel > intrinsically unreasonable to me, and I hadn't thought about that as a > potential attack vector. It seems to me like that's _the_ primary attack vector. I think I agree with you that the password requirement is an overly large hammer, but I don't think it's right (or safe/helpful to DBAs reading along) to describe it as a manufactured concern. > If I'm asked to attempt to connect to a PostgreSQL server, and I > choose to do that, and the connection succeeds, all I know is that the > connection actually succeeded. I do not know why the remote machine > chose to accept the connection. If I supplied a password or an SSL > certificate or some such thing, then it seems likely that the remote > machine accepted that connection because I supplied that particular > password or SSL certificate, but it could also be because the remote > machine accepts all connections from Robert, or all connections > whatsoever, or all connections on Mondays. I just don't know. As of SYSTEM_USER, I think this is no longer the case -- after connection establishment, you can ask the server who was authenticated and why. (It doesn't explain why you were authorized to be that particular user, but that seems maybe less important wen you're trying to disallow ambient authentication.) If my require_auth patchset gets in, you'd be able to improve on this by rejecting all ambient forms of authentication at the protocol level (require_auth=password,md5,scram-sha-256). You could even go a step further and disable ambient transport authentication (sslcertmode=disable gssencmode=disable), which keeps a proxied connection from making use of a client cert or a Kerberos cache. But for postgres_fdw, at least, that carries a risk of disabling current use cases. Stephen and I had a discussion about one such case in the Kerberos delegation thread [1]. It doesn't help you if you want to differentiate one form of ambient auth (trust/peer/etc.) from another, since they look the same to the protocol. But for e.g. postgres_fdw I'm not sure why you would want to differentiate between those cases, because they all seem bad. > To put that another way, if I'm making a connection on behalf of an > untrusted party, I can choose not to supply an SSL certificate, or not > to supply a password. But I cannot choose to not be myself. (IMO, you're driving towards a separation of the proxy identity from the user identity. Other protocols do that too.) --Jacob [1] https://www.postgresql.org/message-id/flat/23337c51-7a48-d5a8-569d-ef3ce6fe235f%40timescale.com#38b4033256d9d95773963ce938cbe3ea
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix possible crash in tablesync worker.
- b5c517379a40 16.0 landed
-
Display 'password_required' option for \dRs+ command.
- 19e65dff38bd 16.0 landed
-
Restart the apply worker if the 'password_required' option is changed.
- c1cc4e688b60 16.0 landed
-
Fix possible logical replication crash.
- e7e7da2f8d57 16.0 landed
-
Add new predefined role pg_create_subscription.
- c3afe8cf5a1e 16.0 landed
-
Expand AclMode to 64 bits
- 7b378237aa80 16.0 cited
-
More cleanup of a2ab9c06ea.
- 96a6f11c0625 15.0 landed
-
Respect permissions within logical replication.
- a2ab9c06ea15 15.0 landed
-
Improve table locking behavior in the face of current DDL.
- 2ad36c4e44c8 9.2.0 cited