Connect Single Origin to OSS Trino
Create a read-only login and metadata-only access rules on your Trino coordinator.
Single Origin reads metadata only from your Trino cluster: catalog, schema, table, view and column information exposed through Trino's information_schema and system catalogs. It never reads the contents of your tables.
You connect Single Origin by creating a dedicated read-only login and granting it metadata access on your coordinator. Everything stays in your environment.
How access works in Trino
Trino differs from managed warehouses in two ways that shape this setup:
- No built-in user store. Authentication is pluggable: password file, LDAP, OAuth 2.0, Kerberos or client certificates. You create or designate a login for Single Origin in whichever mechanism your cluster already uses.
- Access control lives on the coordinator. It is configured through files (or a policy engine such as OPA or Ranger), not
GRANTstatements. Object and column metadata is exposed through theinformation_schemaschema in each catalog. Query, task and optimizer metadata lives in thesystemcatalog. Table data is only readable with theSELECTprivilege.
Open-source Trino has no single "metadata-only" privilege like a managed warehouse has. The setup below makes catalogs visible, lets Single Origin read information_schema and the specific system.runtime tables it needs, and withholds SELECT on your data tables, so no row data is readable. information_schema is exempt from table rules, but the system catalog is not, so access to system.runtime is granted explicitly.
What you're granting
| Grant | What it allows |
|---|---|
| A login (for example, a password-file entry) | Lets Single Origin authenticate to the coordinator over TLS. |
Catalog visibility and information_schema access | Read object and column metadata for the catalogs you expose. |
SELECT on system.runtime.queries, system.runtime.tasks and system.runtime.optimizer_rule_stats | Read query, task and optimizer metadata. |
view query permission | See queries owned by all users (not just Single Origin's own) in system.runtime. |
No SELECT on your data tables | Single Origin can read metadata but cannot read the rows in your tables. |
Before you start
You'll need:
- Access to the coordinator configuration files and the ability to restart or refresh it.
- TLS (HTTPS) enabled on the coordinator. Password authentication requires it.
- To know which access control system your cluster runs today (see the warning below).
- The catalogs to expose, and your coordinator's host, port and TLS details.
Read this before editing access control. Trino's file-based access control governs every user, and if no rule matches a user, access is denied. If your cluster doesn't already use file-based access control, introducing a rules file can lock out your existing users. Merge the Single Origin entries into your existing rules; don't drop in a fresh file as your whole policy. If you use OPA or Ranger, add an equivalent metadata-only policy there. The concepts below map directly; the syntax differs.
Option 1: Create a login (password file)
If your cluster uses password-file authentication, add a user with Apache's htpasswd and bcrypt:
htpasswd -B -C 10 /etc/trino/password.db single_originThe password authenticator is configured in etc/password-authenticator.properties:
password-authenticator.name=file
file.password-file=/etc/trino/password.dbIf your cluster uses LDAP, OAuth 2.0 or certificates, create or designate a Single Origin principal there instead. The access-control steps below are the same however the user authenticates.
Option 2: Grant metadata-only access
File-based access control is configured on the coordinator in etc/access-control.properties:
access-control.name=file
security.config-file=/etc/trino/rules.jsonIn rules.json, merge the following entries for the single_origin user into your existing rules. They make all catalogs visible to Single Origin, grant SELECT on the system.runtime tables Single Origin reads, and grant no privileges on your data tables. Metadata is readable; row data is not.
{
"catalogs": [
{
"user": "single_origin",
"catalog": ".*",
"allow": "all"
}
],
"tables": [
{
"user": "single_origin",
"catalog": "system",
"schema": "runtime",
"table": "queries|tasks|optimizer_rule_stats",
"privileges": ["SELECT"]
},
{
"user": "single_origin",
"catalog": ".*",
"schema": ".*",
"table": ".*",
"privileges": []
}
],
"queries": [
{
"user": "single_origin",
"allow": ["execute", "view"]
}
]
}Three parts make these rules work:
- Table access. The
systemcatalog is not exempt from table rules (onlyinformation_schemais). The first table rule grantsSELECTonsystem.runtime.queries,system.runtime.tasksandsystem.runtime.optimizer_rule_stats. It must come before the catch-all[]rule, because the first matching rule wins. - No data access. The second table rule grants empty privileges on everything else, so Single Origin can't
SELECTrow data from your tables. Object and column metadata stays readable through each catalog'sinformation_schema, which is exempt from table rules. - Query visibility. By default a user sees only their own queries in
system.runtime.queriesandsystem.runtime.tasks. Thequeriesrule givessingle_origintheviewpermission for queries owned by any user (the omittedqueryOwnerdefaults to.*), plusexecuteso it can run its own metadata queries.
After editing, restart the coordinator, or let the change apply on its own if you've set security.refresh-period.
The
queriesrule governs every user. If your cluster doesn't already define query rules, the default lets all users execute, view and kill any query. Adding aqueriesblock changes that: any user not matched by a rule is denied query execution. If you're adding query rules for the first time, add a fallback rule for your other users so you don't lock them out, for example a trailing{ "allow": ["execute", "view", "kill"] }. Merge into your existing query rules rather than replacing them.
Confirm the connector's metadata interface. Single Origin reads object and column metadata from
information_schema. If your connector instead retrieves it through the JDBC metadata calls that map tosystem.jdbc, add aSELECTrule for thesystemcatalog'sjdbcschema as well. How thesystem.jdbctables behave under table rules can vary by Trino version. Check with your Single Origin contact which interface is used.
A simpler alternative (permits data reads)
If you're comfortable with the Single Origin user reading data as well as metadata, Trino's built-in read-only access control is much simpler. Set this in etc/access-control.properties:
access-control.name=read-onlyThis allows any read operation (SELECT and SHOW) and blocks all writes. It is not metadata-only: it permits reading table data. It also applies to every user on the cluster, not only Single Origin. Use the file-based approach above if you need the metadata-only guarantee.
Finish up
Once the login and rules are in place, send your coordinator's host, port and TLS details, and the single_origin credentials, to your Single Origin contact (or enter them in the onboarding flow). Single Origin connects and starts reading metadata. No further action is needed on your side.
Revoking access
You can remove Single Origin's access at any time:
-
Delete the Single Origin entries from
rules.json(or its policy in OPA or Ranger). -
Remove the login. For a password file:
htpasswd -D /etc/trino/password.db single_origin -
Restart the coordinator, or wait for the refresh period to apply the change.
Updated 9 days ago