You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Use the [Permit Policy Editor](https://app.permit.io/policy-editor) (or via API, SDK, etc.) to grant roles actions such as `trino_sys#ExecuteQuery` and table-level `SelectFromColumns`.
50
-
- Test queries as different users and confirm audit entries appear both in Permit and Trino.
51
-
- Use the [Permit Audit Logs](https://app.permit.io/audit-log) to review the access control decisions.
50
+
- Use the [Permit Policy Editor](https://app.permit.io/policy-editor) (or via API, SDK, etc.) to grant roles actions such as `trino_sys#ExecuteQuery` and table-level `SelectFromColumns`.
51
+
- Test queries as different users and confirm audit entries appear both in Permit and Trino.
52
+
- Use the [Permit Audit Logs](https://app.permit.io/audit-log) to review the access control decisions.
52
53
53
54
Want a sandbox that shows the full stack running? Try the public demo: https://github.com/permitio/trino-authz-example
54
55
55
56
:::warning Warning:
56
-
Trino does not currently support passing an API key or credentials when calling external authorization endpoints.
57
+
Trino does not currently support passing an API key or credentials when calling external authorization endpoints.
57
58
As a result, you must expose the PDP's Trino authorization routes (such as `/trino/allowed`, `/trino/row-filter`, `/trino/batch-column-masking`) without authentication, by setting `PDP_ALLOW_UNAUTHENTICATED_TRINO=True`.
58
59
59
-
Because these endpoints are unauthenticated, **do not expose your PDP** to the public internet or any untrusted networks.
60
-
Always deploy the PDP behind a firewall or within a secure, trusted network accessible only by the Trino cluster.
60
+
Because these endpoints are unauthenticated, **do not expose your PDP** to the public internet or any untrusted networks.
61
+
Always deploy the PDP behind a firewall or within a secure, trusted network accessible only by the Trino cluster.
61
62
62
63
For more information, follow the [Trino issue](https://github.com/trinodb/trino/issues/27022) on this topic.
63
64
:::
@@ -74,14 +75,14 @@ Access is granted only when the user is permitted for **all** required columns.
74
75
This allows scenarios where a user lacks table-level permissions but can still read a safe subset of columns.
75
76
76
77
```mermaid
77
-
%%{
78
+
%%{
78
79
init: {
79
80
"theme": "base",
80
81
"themeVariables": { "wrap": "false" },
81
-
"flowchart": {
82
+
"flowchart": {
82
83
"curve": "linear",
83
84
"markdownAutoWrap":"false",
84
-
"wrappingWidth": "600"
85
+
"wrappingWidth": "600"
85
86
}
86
87
}
87
88
}%%
@@ -106,7 +107,8 @@ You can generate Permit column resources automatically with the CLI flag `--crea
106
107
107
108
### Column-masking
108
109
109
-
Permit can instruct Trino to mask sensitive column values instead of blocking the query outright. Masks are defined in a YAML file that the PDP reads on startup:
110
+
Permit can instruct Trino to mask sensitive column values instead of blocking the query outright.
111
+
Masks are defined in a YAML file that the PDP reads on startup:
Masks return only when the user (or role) has the corresponding Permit action.
130
+
Masks return only when the user (or role) has the corresponding Permit action.
129
131
You can review the [Audit Logs](https://app.permit.io/audit-log) to see the Permit action checked on the table resource, causing the mask to be applied.
130
132
131
133
For more information, see the [Trino documentation](https://trino.io/docs/current/security/opa-access-control.html#column-masking).
@@ -186,61 +188,61 @@ Every query to Trino triggers a call to the PDP. Permit returns `allow` or `deny
186
188
187
189
### Permit / Trino Resource Mapping
188
190
189
-
When the Permit PDP receives an authorization request from Trino, it maps the request into a `permit.check()` call.
191
+
When the Permit PDP receives an authorization request from Trino, it maps the request into a `permit.check()` call.
190
192
The resource name and actions are converted to the corresponding Trino resource and action the user is trying to perform.
191
193
192
-
All queries are checked with the current Trino user's identity, with permissions on the "default" tenant.
194
+
All queries are checked with the current Trino user's identity, with permissions on the "default" tenant.
193
195
You can use Trino's several Authentication mechanisms to identify the user, like [JWT](https://trino.io/docs/current/security/jwt.html) or [OAuth2](https://trino.io/docs/current/security/oauth2.html).
194
196
195
197
By default, if the query does not match any resource or action in Permit, the request is denied. You are not required to create a resource for every table in your database.
This resource represents the entire Trino system. Actions here apply at the highest level, governing general permissions such as running queries or impersonating users across the cluster.
A catalog in Trino represents a data source connection—such as a database or data warehouse. This resource governs access and management permissions for that catalog.
A schema organizes database objects within a catalog, grouping related tables. This resource allows control over schema-level actions like listing, creating, or administering schemas.
A function in Trino is a reusable computation or operation available within a schema. This resource is used to control who can execute or create that function.
The command will need permissions to read the Trino schema. You can use the `--user` flag to specify a user that has the necessary permissions.
274
276
275
-
The command only adds resources. Removing a table or column in Trino does not delete the Permit resource automatically; you can remove the resource manually in the Permit UI.
277
+
The command only adds resources. Removing a table or column in Trino does not delete the Permit resource automatically; you can remove the resource manually in the Permit UI.
276
278
277
-
Modifying the Trino schema, like adding a new table or column, will not automatically update the Permit resources.
279
+
Modifying the Trino schema, like adding a new table or column, will not automatically update the Permit resources.
278
280
You will need to run the command again to add the new resources. Trino resources that are not mapped to Permit resources will be denied.
279
281
280
282
### PDP Trino config file
@@ -311,7 +313,7 @@ rowFilters:
311
313
- action: filter_out_todo
312
314
```
313
315
314
-
After updating the file, restart the PDP so the changes take effect.
316
+
After updating the file, restart the PDP, so the changes take effect.
315
317
316
318
### Trino coordinator configuration
317
319
@@ -326,13 +328,13 @@ opa.log-requests=true
326
328
opa.log-responses=true
327
329
```
328
330
329
-
After updating the file, restart the coordinator so the plugin reloads its configuration.
331
+
After updating the file, restart the coordinator, so the plugin reloads its configuration.
330
332
331
333
## Operational considerations
332
334
333
335
### Multiple access control systems
334
336
335
-
Trino supports [multiple access control systems](https://trino.io/docs/current/security/built-in-system-access-control.html#multiple-access-control-systems).
337
+
Trino supports [multiple access control systems](https://trino.io/docs/current/security/built-in-system-access-control.html#multiple-access-control-systems).
336
338
Using that, you can combine Permit authorization for application users, and Trino's built-in file-based access control for administrative users.
337
339
338
340
### Trino authentication
@@ -345,10 +347,10 @@ For more information, see the [Trino authentication documentation](https://trino
345
347
346
348
### Policy isolation
347
349
348
-
We recommend using a dedicated Permit project and environments for the Trino cluster authorization.
350
+
We recommend using a dedicated Permit project and environments for the Trino cluster authorization.
349
351
This will help you isolate the authorization decisions from the rest of your data.
350
352
351
-
Your database schema can include many resources and actions.
353
+
Your database schema can include many resources and actions.
352
354
Using a dedicated Permit project and environments will help you manage the complexity, follow audit trails, and isolate the authorization decisions from the rest of your data.
353
355
354
356
Read more about [Permit projects and environments](/manage-your-account/projects-and-env).
0 commit comments