Skip to content

Commit 9d5b214

Browse files
adwk67fhennig
andauthored
docs: rego rule summary and links (#581)
* added links and rego-rule summary * added bundle flag * Update docs/modules/trino/pages/usage-guide/security.adoc Co-authored-by: Felix Hennig <fhennig@users.noreply.github.com> * Update docs/modules/trino/pages/usage-guide/security.adoc Co-authored-by: Felix Hennig <fhennig@users.noreply.github.com> * Update docs/modules/trino/pages/usage-guide/security.adoc Co-authored-by: Felix Hennig <fhennig@users.noreply.github.com> --------- Co-authored-by: Felix Hennig <fhennig@users.noreply.github.com>
1 parent 9b5964a commit 9d5b214

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ The following example is an all-access Rego rule for testing with the user `admi
101101
Do not use it in production!
102102
The rego rules below are written using Rego V1 to be compatible with the OPA v1.0.0 release.
103103

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+
104108
NOTE: Due to changes in the Trino OPA authorizer, rego rules differ between version 414, 428 and newer versions.
105109

106110
[tabs]
@@ -144,6 +148,26 @@ spec:
144148
<1> The name of the OpaCluster
145149
<2> The name of the package defined in the rego rule ConfigMap
146150

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+
147171
== Define a secure cluster
148172

149173
For secure connections the following steps must be taken:

0 commit comments

Comments
 (0)