Skip to content

Commit 11bd281

Browse files
Document different regorules for v414 and v428 due to authorizer changes (#494)
* Document different regorules for v414 and v428 due to authorizer changes * Update docs/modules/trino/pages/usage-guide/security.adoc Co-authored-by: Sebastian Bernauer <sebastian.bernauer@stackable.de> * Point to readme in PR instead of hardlink to avoid dead link in the future --------- Co-authored-by: Sebastian Bernauer <sebastian.bernauer@stackable.de>
1 parent 30ffb42 commit 11bd281

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: opa-bundle-trino
6+
labels:
7+
opa.stackable.tech/bundle: "true"
8+
data:
9+
trino.rego: |
10+
package trino
11+
12+
import future.keywords.in
13+
14+
default allow = false
15+
16+
allow {
17+
is_admin
18+
}
19+
extended[i] {
20+
some i
21+
input.action.filterResources[i]
22+
is_admin
23+
}
24+
25+
is_admin() {
26+
input.context.identity.user == "admin"
27+
}

docs/modules/trino/pages/usage-guide/security.adoc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,20 @@ In the Trino CLI and web interface, LDAP users can now be used to log in.
7474
In order to authorize Trino via OPA, a ConfigMap containing a rego rule package for Trino has to be applied and referenced in the TrinoCluster resource.
7575
The following example is an all-access Rego rule for testing with the user `admin`. Do not use it in production!
7676

77+
NOTE: Due to changes in the Trino OPA authorizer, rego rules differ between version 414 and 428. The OPA authorizer will become part of the Trino package once this https://github.com/trinodb/trino/pull/19532[pull request] is merged. The stackable Trino version 428 already uses that new OPA authorizer and utilizes the _batch mode_ (documented in the readme file https://github.com/trinodb/trino/pull/19532[here]) to avoid multiple queries to OPA. This is under active development and is not stable yet!
78+
79+
=== Rego for Trino version 414
80+
81+
[source,yaml]
82+
----
83+
include::example$usage-guide/opa-bundle-trino-cm-414.yaml[]
84+
----
85+
86+
=== Rego for Trino version 428
87+
7788
[source,yaml]
7889
----
79-
include::example$usage-guide/opa-bundle-trino-cm.yaml[]
90+
include::example$usage-guide/opa-bundle-trino-cm-428.yaml[]
8091
----
8192

8293
Reference the package in the Trino cluster:

0 commit comments

Comments
 (0)