docs/src/main/sphinx/security/group-mapping.md
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.
:::{list-table} Group provider configuration :widths: 40, 60 :header-rows: 1
group-provider.name
Name of the group provider to use. Supported values are:
file: See configurationldap: See configurationgroup-provider.group-case
Optional transformation of the case of the group name. Supported values are:
keep: default, no conversionupper: convert group name to UPPERCASElower: converts the group name to lowercaseDefaults to keep.
:::
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.
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:
:::{list-table} File group provider configuration :widths: 40, 60 :header-rows: 1
file.group-filefile.refresh-period5s.
:::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.
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
:::{list-table} Generic LDAP properties :widths: 40, 60 :header-rows: 1
ldap.urlldap://host:389 or ldaps://host:636.ldap.allow-insecurefalse.ldap.ssl.keystore.pathldap.ssl.keystore.passwordldap.ssl.truststore.pathldap.ssl.truststore.passwordldap.ignore-referralsfalse.ldap.timeout.connect1m.ldap.timeout.read1m.ldap.admin-userCN=UserName,OU=City,OU=State,DC=domain,DC=domain_rootldap.admin-passwordldap.user-base-dndc=example,dc=com.ldap.user-search-filter{0} is replaced with the Trino username.
For example, (cn={0})ldap.group-name-attributecn.ldap.use-group-filtertrue.
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:
:::{list-table} Search-based group resolution :widths: 40, 60 :header-rows: 1
ldap.group-base-dndc=example,dc=com.ldap.group-search-filter(cn=trino_*).ldap.group-search-member-attributecn.
:::In case of attribute-based group resolution, Trino reads the group list directly from a user attribute. This requires the following property:
:::{list-table} Attribute-based (single query) group resolution :widths: 40, 60 :header-rows: 1
ldap.user-member-of-attributememberOf.
:::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