-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql: grant CONNECT privilege to PUBLIC role on new databases #70098
Comments
Thanks for filing this, I'll check it out. |
The CONNECT privilege is in a slightly odd spot right now. It exists because some applications rely on it to allow a role to see metadata (pg_catalog) from a database, but we don't actually use it when checking if a role can connect to a database: #59875 |
Thanks for the background Rafi. Until we address #59875, should we be considering all users to have the CONNECT privilege in |
I'm just curious, is there a specific reason you're looking into this? Does PostgREST rely on checking The If anything, we should investigate where |
the issue i see with always returning true for
i agree with that. the first and least invasive step here would be to start granting |
I thought it did here, but upon a re-read, it looks like I was wrong. Instead, it queries the cockroach/pkg/sql/pg_catalog.go Line 1947 in d6195d4
I think this would be the preferred long-term solution, as it would resolve this entire class of incompatibility.
Would we want to grant CONNECT to each existing user for all databases, or just grant CONNECT to PUBLIC for all databases? |
More just like now people have visibility into other databases when they didn't before, and I'm not sure we should retroactively store that as the default |
I'll close this, and if we ever want the migration, it should be done as part of #59875 |
This is somewhere between a bug and a Postgres-incompatability.
From https://www.postgresql.org/docs/current/ddl-priv.html:
Note specifically the "CONNECT and TEMPORARY (create temporary tables) privileges for databases" part.
I don't think we'll be able to solve the TEMPORARY privilege part right now, because we don't separate the CREATE and TEMPORARY privileges. However, we should be able to resolve the CONNECT part, one way or another.
In PostgreSQL:
In CockroachDB:
It looks like this might actually be an introspection issue, as we do allow the new role to connect to each database. So it's not clear to me exactly what's wrong here. Should PUBLIC be represented in
crdb_internal.cluster_database_privileges
? Shouldhas_database_privilege
assume that all roles have CONNECT privileges to all databases?@RichardJCai are you the right person to evaluate what we should do here?
Epic CRDB-10300
The text was updated successfully, but these errors were encountered: