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
Copy file name to clipboardExpand all lines: docs/modules/trino/pages/usage-guide/security.adoc
+24Lines changed: 24 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -101,6 +101,10 @@ The following example is an all-access Rego rule for testing with the user `admi
101
101
Do not use it in production!
102
102
The rego rules below are written using Rego V1 to be compatible with the OPA v1.0.0 release.
103
103
104
+
NOTE: For a production setup you will use something much more granular.
105
+
We provide a detailed set of rego rules in our integration tests.
106
+
Details can be found below in the <<fine-granular-rego-rules, fine-granular rego rule>> section.
107
+
104
108
NOTE: Due to changes in the Trino OPA authorizer, rego rules differ between version 414, 428 and newer versions.
105
109
106
110
[tabs]
@@ -144,6 +148,26 @@ spec:
144
148
<1> The name of the OpaCluster
145
149
<2> The name of the package defined in the rego rule ConfigMap
146
150
151
+
[#fine-granular-rego-rules]
152
+
=== Fine-granular rego rules
153
+
154
+
The operator repository contains a more production-ready set of rego-rules in https://github.com/stackabletech/trino-operator/tree/main/tests/templates/kuttl/opa-authorization[this] integration test.
155
+
The test uses the following:
156
+
157
+
* a set of https://github.com/stackabletech/trino-operator/tree/main/tests/templates/kuttl/opa-authorization/trino_rules[rules] provided by the Stackable Data Platform, together with associated test files that can be used directly with OPA (i.e. outside the integration test context)
158
+
** these files can be tested by using the https://www.openpolicyagent.org/docs/latest/policy-testing[built-in] policy test functionality and running `opa test <path-to-trino-rule-folder> -b`
159
+
* a sample set of https://github.com/stackabletech/trino-operator/blob/main/tests/templates/kuttl/opa-authorization/trino_policies.rego[trino policies] that represents what is to be provided by the user.
160
+
161
+
The rules implement https://trino.io/docs/current/security/file-system-access-control.html#system-level-access-control-files[system-level access control] files (https://trino.io/docs/current/security/file-system-access-control.html#catalog-level-access-control-files[catalog-level access control] is currently not provided).
162
+
As illustrated by the integration test, both internal and customer-provided policies are deployed as ConfigMaps and there is thus no requirement for an extra configuration file in JSON to be created.
163
+
164
+
Please note these additional points:
165
+
166
+
* Roles are not checked, only users and groups.
167
+
* Principal rules are https://trino.io/docs/current/security/file-system-access-control.html#principal-rules[deprecated] and not implemented.
168
+
* The `allow` property of the https://trino.io/docs/current/security/file-system-access-control.html#catalog-rules[catalog rules] accepts only the new values `all`, `read-only`, and `none`, but not the legacy values `true` and `false`.
169
+
* The Rego rules attempt to implement the Java implementation as close as possible although this is not always reflected clearly in the documentation (for instance the documentation https://trino.io/docs/current/security/file-system-access-control.html#impersonation-rules[states] that "_If neither impersonation nor principal rules are defined, impersonation is not allowed_", although in practice users are always allowed to impersonate themselves).
170
+
147
171
== Define a secure cluster
148
172
149
173
For secure connections the following steps must be taken:
0 commit comments