You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "fzhsbc (via GitHub)" <gi...@apache.org> on 2026/06/01 02:57:48 UTC

[I] [FEATURE] Support trusted delegated authorization for Trino using Gravitino RBAC [gravitino]

fzhsbc opened a new issue, #11307:
URL: https://github.com/apache/gravitino/issues/11307

   ### Describe the feature
   
   I would like to propose an official Gravitino integration path for enforcing Gravitino RBAC from Trino's authenticated session identity, especially for BI/JDBC/ODBC deployments.
   
   Gravitino already has Trino connector authentication and session forwarding support, including `gravitino.client.session.forwardUser=true` for simple auth. That is useful, but it still leaves an important deployment gap:
   
   - Trino is often the system that authenticates end users, for example through password, OAuth2, LDAP, Kerberos, or an enterprise gateway.
   - BI tools such as PowerBI, Superset, Looker, JDBC, or ODBC clients may not be able to forward a Gravitino-audience OAuth token reliably to Gravitino.
   - In those deployments, the trusted identity boundary is Trino's authenticated `Identity`, not a user name or token self-reported by the downstream client.
   - Gravitino RBAC should still be the policy source for metadata objects, instead of maintaining a second policy system only in Trino.
   
   ### Motivation
   
   For a multi-user Trino deployment backed by Gravitino, a common desired flow is:
   
   ```text
   BI/JDBC/ODBC user -> Trino authentication -> Trino Identity -> Gravitino RBAC authorization -> query allowed/denied
   ```
   
   The security property we need is: the user name sent to Gravitino for an authorization decision must be derived from Trino's authenticated session identity and accepted only from a trusted Trino service principal.
   
   Forwarding a user token to Gravitino is not always practical because some BI/ODBC clients cannot provide a suitable Gravitino-audience OAuth token. Forwarding only a client-supplied user name is also not sufficient unless Trino has already authenticated and bound that name to the session identity.
   
   ### Describe the solution
   
   A possible upstream-friendly design could include the following pieces:
   
   1. A Gravitino-side delegated authorization API, for example:
   
   ```text
   POST /api/metalakes/{metalake}/authorize
   ```
   
   The request would contain the target end user, metadata object, privilege, and optional audit context such as Trino query ID. The endpoint should only accept requests from configured trusted service principals, such as a Trino coordinator service account.
   
   2. A documented Trino integration using Trino's `SystemAccessControl` SPI.
   
   Trino's SPI already provides hooks such as `checkCanSelectFromColumns`, `checkCanInsertIntoTable`, `checkCanCreateTable`, `checkCanDropTable`, `checkCanDeleteFromTable`, and `checkCanUpdateTableColumns`. A Gravitino-provided or documented SystemAccessControl plugin could translate those checks into Gravitino metadata objects and privileges such as `USE_CATALOG`, `USE_SCHEMA`, `SELECT_TABLE`, `MODIFY_TABLE`, `CREATE_TABLE`, `CREATE_VIEW`, etc.
   
   3. A clear separation between service authentication and end-user authorization.
   
   The Trino service authenticates to Gravitino using a service credential. The end user is not authenticated to Gravitino by presenting a token directly; instead, Gravitino authorizes the end user only because the request comes from a trusted Trino principal and Trino has already authenticated the session user.
   
   4. Security requirements documented explicitly:
   
   - Trino must enable real user authentication; anonymous/shared-user deployments cannot provide per-user RBAC.
   - Trino must prevent user spoofing through user mapping / impersonation controls.
   - Gravitino should fail closed if the delegated authorization request cannot be validated.
   - The Gravitino audit log should record both the trusted caller and delegated end user.
   
   ### Alternatives considered
   
   - **Only use connector session forwarding**: useful when Trino can forward a suitable user identity or token to Gravitino, but it does not fully address BI/ODBC deployments where Gravitino-audience user tokens are unavailable.
   - **Require BI clients to forward OAuth tokens to Gravitino**: not always practical and couples BI client capabilities to Gravitino authentication details.
   - **Maintain policies only in Trino**: works technically through Trino access control, but duplicates Gravitino RBAC and risks policy drift.
   - **Trust a user name directly from the client**: unsafe unless Trino authenticates and binds that user name first.
   
   ### Additional context
   
   Related work:
   
   - #10003 added Gravitino server authentication support for the Trino connector.
   - #10559 and #10730 added session user forwarding for the Gravitino Trino connector.
   
   This proposal is narrower than a generic token translation service. It focuses on the case where Trino is the trusted query engine and Gravitino remains the central RBAC policy decision point for metadata objects.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [FEATURE] Support trusted delegated authorization for Trino using Gravitino RBAC [gravitino]

Posted by "fzhsbc (via GitHub)" <gi...@apache.org>.
fzhsbc commented on issue #11307:
URL: https://github.com/apache/gravitino/issues/11307#issuecomment-4589277347

   I submitted a documentation PR to clarify the current Trino authorization identity boundary and deployment guidance: #11309. The PR does not implement a delegated authorization API yet; it documents the current safe deployment guidance and the gap this issue tracks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [FEATURE] Support trusted delegated authorization for Trino using Gravitino RBAC [gravitino]

Posted by "LuciferYang (via GitHub) via commits" <co...@gravitino.apache.org>.
LuciferYang commented on issue #11307:
URL: https://github.com/apache/gravitino/issues/11307#issuecomment-6576670850

   I wrote a design for this issue: #14539. It takes a different shape from the decision API sketched above.
   
   A trusted service sends the end user in an `X-Gravitino-Proxy-User` header, and Gravitino checks it against server-side proxy rules, as Hadoop proxy users do. A `POST /api/metalakes/{metalake}/authorize` endpoint answers only allow or deny: the connector's metadata calls would still run as the service account, so ownership and audit stay wrong, and Lance REST (#13090) is not covered. The doc's Solution Investigations section compares the two.
   
   @fzhsbc, I'd like to hear your view before implementation. cc @diqiu50 for the Trino connector changes, and @yuqi1129 since #13092 covers the same need for Lance REST.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [FEATURE] Support trusted delegated authorization for Trino using Gravitino RBAC [gravitino]

Posted by "LuciferYang (via GitHub) via commits" <co...@gravitino.apache.org>.
LuciferYang commented on issue #11307:
URL: https://github.com/apache/gravitino/issues/11307#issuecomment-6685617425

   Thanks @fzhsbc, I've updated #14539.
   
   - Trino: Goal 3 now covers per-user metadata authorization only. Security considerations require Trino system access control, or storage that checks each Trino user's own permissions, for catalogs whose users may read but not write. Checking `MODIFY_TABLE` on the connector's write paths is a follow-up task, with your test: a user with only `SELECT_TABLE` can read and is denied before any storage write.
   - Iceberg REST: Non-Goal 4 now describes the two routes separately. By default the connector routes Iceberg catalogs whose backend is not `rest` through the Iceberg REST service, and Trino's native client cannot send the proxy header, so in proxy mode the connector refuses to register such a catalog rather than run it as the route's identity. For a `rest` backend, reached through the Gravitino API or the Iceberg REST service, `user-token` mode fails for proxied principals. In `service-account` mode (#14595), Gravitino authorizes the proxied user, when authorization is enabled, before it calls the remote catalog as the service account.
   - Groups and audit: a group's `DENY` applies to a proxied user only when the proxy declares that group, so the doc now requires the groups a rule allows to come from a source that is complete as well as authoritative. Proxied requests also record `realUserAuthenticator`, and `realUserIssuer` for OAuth, next to `user` and `realUser`.
   - Rollout: servers behind one address must keep the feature while clients proxy through it. Before one of them is downgraded, the clients stop proxying or that server leaves the address.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [FEATURE] Support trusted delegated authorization for Trino using Gravitino RBAC [gravitino]

Posted by "fzhsbc (via GitHub) via commits" <co...@gravitino.apache.org>.
fzhsbc commented on issue #11307:
URL: https://github.com/apache/gravitino/issues/11307#issuecomment-6676440579

   > I wrote a design for this issue: [#14539](https://github.com/apache/gravitino/pull/14539). It takes a different shape from the decision API sketched above.
   > 
   > A trusted service sends the end user in an `X-Gravitino-Proxy-User` header, and Gravitino checks it against server-side proxy rules, as Hadoop proxy users do. A `POST /api/metalakes/{metalake}/authorize` endpoint answers only allow or deny: the connector's metadata calls would still run as the service account, so ownership and audit stay wrong, and Lance REST ([#13090](https://github.com/apache/gravitino/issues/13090)) is not covered. The doc's Solution Investigations section compares the two.
   > 
   > [@fzhsbc](https://github.com/fzhsbc), I'd like to hear your view before implementation. cc [@diqiu50](https://github.com/diqiu50) for the Trino connector changes, and [@yuqi1129](https://github.com/yuqi1129) since [#13092](https://github.com/apache/gravitino/issues/13092) covers the same need for Lance REST.
   
   Thanks @LuciferYang. I support the trusted-proxy approach. It reuses Gravitino RBAC and preserves end-user ownership and audit, so I’m happy to leave /authorize and a Trino SystemAccessControl plugin out of v1.
   
   Trino: Scope v1 to delegated metadata authorization and require read-only access or separate write controls. Before claiming query-level RBAC, verify that a SELECT_TABLE-only user can read but cannot write, with denial before any storage side effect.
   
   Iceberg REST: Document Trino-to-IRC separately from IRC-to-remote federation, which supports both user-token forwarding and service-account mode. Reject unsupported routes in delegated mode to prevent fallback to a service identity.
   
   Groups and audit: Forward groups only from an authoritative, complete source. Omitting a group can drop a DENY. Record the effective user and the proxy’s authenticator, principal, and OAuth issuer where applicable.
   
   Since the response header is checked after execution, proxy traffic should reach only upgraded nodes, including during rollback.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org