Skip to main content

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.

Group provider configuration

Property nameDescription
group-provider.nameName of the group provider to use. Supported values are:
* file: See configuration * ldap: See configuration
group-provider.group-caseOptional transformation of the case of the group name. Supported values are:
* keep: default, no conversion * upper: convert group name to UPPERCASE * lower: converts the group name to lowercase
Defaults to keep.

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:

File group provider configuration

Property nameDescription
file.group-filePath of the group file.
file.refresh-periodDuration between refreshing the group mapping configuration from the file. Defaults to 5s.

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

Generic LDAP properties

Property nameDescription
ldap.urlLDAP server URI. For example, ldap://host:389 or ldaps://host:636.
ldap.allow-insecureAllow insecure connection to the LDAP server. Defaults to false.
ldap.ssl.keystore.pathPath to the PEM or JKS key store.
ldap.ssl.keystore.passwordPassword for the key store.
ldap.ssl.truststore.pathPath to the PEM or JKS trust store.
ldap.ssl.truststore.passwordPassword for the trust store.
ldap.ignore-referralsReferrals allow finding entries across multiple LDAP servers. Ignore them to only search within one LDAP server. Defaults to false.
ldap.timeout.connectTimeout duration for establishing a connection. Defaults to 1m.
ldap.timeout.readTimeout duration for reading data from LDAP. Defaults to 1m.
ldap.admin-userBind distinguished name for admin user. For example, CN=UserName,OU=City,OU=State,DC=domain,DC=domain_root
ldap.admin-passwordBind password used for the admin user.
ldap.user-base-dnBase distinguished name for users. For example, dc=example,dc=com.
ldap.user-search-filterLDAP filter to find user entries; {0} is replaced with the Trino username. For example, (cn={0})
ldap.group-name-attributeAttribute to extract group name from group entry. For example, cn.
ldap.use-group-filterWhether to use search-based group resolution. Defaults to true. When false, Trino uses the attribute-based method.

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:

Search-based group resolution

Property nameDescription
ldap.group-base-dnBase distinguished name for groups. For example, dc=example,dc=com.
ldap.group-search-filterSearch filter for group documents. For example, (cn=trino_*).
ldap.group-search-member-attributeAttribute from group documents used for filtering by member. For example, cn.

In case of attribute-based group resolution, Trino reads the group list directly from a user attribute. This requires the following property:

Attribute-based (single query) group resolution

Property nameDescription
ldap.user-member-of-attributeGroup membership attribute in user documents. For example, memberOf.

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