Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Trino-OPA docs #480

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: ConfigMap
metadata:
name: opa-bundle-trino
labels:
opa.stackable.tech/bundle: "trino"
opa.stackable.tech/bundle: "true"
data:
trino.rego: |
package trino
Expand Down
20 changes: 18 additions & 2 deletions docs/modules/trino/pages/usage_guide/security.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,30 @@ In the Trino CLI and web interface, LDAP users can now be used to log in.

== [[authorization]]Authorization

In order to authorize Trino via OPA, a `ConfigMap` containing Rego rules for Trino has to be applied. The following example is an all-access Rego rule for testing with the user `admin`. Do not use it in production!
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.
The following example is an all-access Rego rule for testing with the user `admin`. Do not use it in production!

[source,yaml]
----
include::example$usage_guide/opa-bundle-trino-cm.yaml[]
----

Users should write their own rego rules for more complex OPA authorization.
Reference the package in the Trino cluster:

[source,yaml]
----
...
spec:
clusterConfig:
authorization:
opa:
configMapName: opa # <1>
package: trino # <2>
...
----

<1> The name of the OpaCluster
<2> The name of the package defined in the rego rule ConfigMap

== Define a secure cluster

Expand Down