Group mapping#
Group providers in Trino map usernames onto groups for easier access control and resource group management.
Configure a group provider by creating an etc/group-provider.properties file
on the coordinator:
group-provider.name=file
The value for group-provider.name must be either file or ldap and the
configuration of the chosen group provider must be included in the same file.
Property name  | 
Description  | 
|---|---|
  | 
Name of the group provider to use. Supported values are: 
  | 
  | 
Optional transformation of the case of the group name. Supported values are: 
 Defaults to   | 
Integration with access control#
Groups resolved by the group provider are passed to Trino’s system access control engine. Access control rules can reference these group names to grant or restrict permissions.
File group provider#
The file group provider resolves group memberships with the configuration in the group-provider.properties file on the coordinator.
Configuration#
Enable the file group provider by creating an etc/group-provider.properties
file on the coordinator:
group-provider.name=file
file.group-file=/path/to/group.txt
The following configuration properties are available:
Group file format#
The group file contains a list of groups and members, one per line, separated by a colon. Users are separated by a comma.
group_name:user_1,user_2,user_3
LDAP group provider#
The LDAP group provider resolves user group memberships from configuration retrieved from an LDAP server. This allows access rules to be defined based on LDAP groups instead of individual users.
Configuration#
Enable LDAP group provider by creating an etc/group-provider.properties file
on the coordinator and add further configuration for the LDAP server
connections and other information as detailed in the following sections.
group-provider.name=ldap
Property name  | 
Description  | 
|---|---|
  | 
LDAP server URI.  For example,   | 
  | 
Allow insecure connection to the LDAP server. Defaults to   | 
  | 
Path to the PEM or JKS key store.  | 
  | 
Password for the key store.  | 
  | 
Path to the PEM or JKS trust store.  | 
  | 
Password for the trust store.  | 
  | 
Referrals allow finding entries across multiple LDAP servers. Ignore them
to only search within one LDAP server. Defaults to   | 
  | 
Timeout duration for establishing a connection.
Defaults to   | 
  | 
Timeout duration for reading data from LDAP.
Defaults to   | 
  | 
Bind distinguished name for admin user. For example,
  | 
  | 
Bind password used for the admin user.  | 
  | 
Base distinguished name for users. For example,   | 
  | 
LDAP filter to find user entries;   | 
  | 
Attribute to extract group name from group entry. For example,   | 
  | 
Whether to use search-based group resolution. Defaults to   | 
Group resolution behavior is controlled by the ldap.use-group-filter property.
With search-based group resolution, Trino searches for group entries that
include the user DN. This requires the following properties:
Property name  | 
Description  | 
|---|---|
  | 
Base distinguished name for groups. For example,   | 
  | 
Search filter for group documents. For example,   | 
  | 
Attribute from group documents used for filtering by member. For example,
  | 
In case of attribute-based group resolution, Trino reads the group list directly from a user attribute. This requires the following property:
Property name  | 
Description  | 
|---|---|
  | 
Group membership attribute in user documents. For example,   | 
Example configurations#
The following configuration is an example for an OpenLDAP (search-based) group provider:
group-provider.name=ldap
group-provider.group-case=lower
ldap.url=ldap://ldap.example.com:389
ldap.admin-user=cn=admin,dc=example,dc=com
ldap.admin-password=your_password
ldap.group-name-attribute=cn
ldap.user-base-dn=ou=users,dc=example,dc=com
ldap.user-search-filter=(uid={0})
ldap.use-group-filter=true
ldap.group-base-dn=ou=groups,dc=example,dc=com
ldap.group-search-filter=(cn=trino_*)
ldap.group-search-member-attribute=member
The following configuration is an example for an Active Directory (single query, attribute-based) group provider:
group-provider.name=ldap
group-provider.group-case=lower
ldap.url=ldaps://ad.example.com:636
ldap.admin-user=cn=admin,dc=example,dc=com
ldap.admin-password=your_password
ldap.group-name-attribute=cn
ldap.user-base-dn=ou=users,dc=example,dc=com
ldap.user-search-filter=(sAMAccountName={0})
ldap.use-group-filter=false
ldap.user-member-of-attribute=memberOf