-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Wrong user impersonated to HMS when querying a view with definer security in Trino >= 371 #15736
Comments
Thanks @findepi, I tested on Trino 370 and indeed view definer identity is correctly passed to metastore when analyzing the query (in newer version this fails on analysis). However, this case still doesn't work as the invoker session is always used during query execution (stored in For this to work Trino would have to support data source impersonation, which I know can get complex. I was thinking if it would be possible to modify |
so we have a regression, let me mark the issue as a bug then. cc @dain @kokosing @lukasz-walkiewicz
Yes, that's a known limitation.
We have been discussing this internally at Starburst. There was no evidence that it would be complex.
I think that this might be possible already today, without any SPI modifications. |
Confirmed, starting from 371 it fails during analyze.
Thanks for the link. It is implemented for JDBC-based connectors now, so to make it work with Hive would require finding a way to capture authorization in Hive connectors. |
With Hive metastore impersonation enabled, when querying a view from Hive catalog with security definer, when this view is defined on a Hive table, both the view and the table metadata will be retrieved from the metastore using the invoker identity. This will cause query failures if HMS has authorization enabled and the invoker has access to the view but not to the table.
To support this we would have to create a new Hive metastore using the session that's impersonating the view definer to retrieve table metadata.
I am creating this to start a discussion whether this is something we would like to support in Trino.
The text was updated successfully, but these errors were encountered: