AssumeRoleWithLDAPIdentity
Table of Contents- AssumeRoleWithLDAPIdentity
Introduction
MinIO provides a custom STS API that allows integration with LDAP based corporate environments including Microsoft Active Directory. The MinIO server can be configured in two possible modes: either using a LDAP separate service account, called lookup-bind mode or in username-format mode. In either case the login flow for a user is the same as the STS flow:- User provides their AD/LDAP username and password to the STS API.
- MinIO verifies the login credentials with the AD/LDAP server.
- On success, MinIO queries the AD/LDAP server for a list of groups that the user is a member of.
- This is done via a customizable AD/LDAP search query.
- MinIO then generates temporary credentials for the user storing the list of groups in a cryptographically secure session token. The temporary access key, secret key and session token are returned to the user.
- The user can now use these credentials to make requests to the MinIO server.
Configuring AD/LDAP on MinIO
LDAP STS configuration can be performed via MinIO’s standard configuration API (i.e. usingmc admin config set/get commands) or equivalently via environment variables. For brevity we refer to environment variables here.
LDAP is configured via the following environment variables:
Supported modes of operation
The two supported modes of LDAP configuration differ in how the MinIO server derives the Distinguished Name (DN) of the user from their username provided in the STS API. Exactly one must be used in a valid configuration. Once a unique DN for the user is derived, the server verifies the user’s credentials with the LDAP server and on success, looks up the user’s groups via a configured group search query and finally temporary object storage credentials are generated and returned.Lookup-Bind Mode
In this mode, the a low-privilege read-only LDAP service account is configured in the MinIO server by providing the account’s Distinguished Name (DN) and password. It is the new and preferred mode for LDAP integration. This service account is used by the MinIO server to lookup a user’s DN given their username. The lookup is performed via an LDAP search filter query that is also configured by the administrator. This mode is enabled by setting the following variables:Username-Format Mode
In this mode, the server does not use a separate LDAP service account. Instead, the username and password provided in the STS API call are used to login to the LDAP server and also to lookup the user’s groups. This mode preserves older behavior for compatibility, but users are encouraged to use the Lookup-Bind mode. The DN to use to login to LDAP is computed from a username format configuration parameter. This is a list of possible DN templates to be used. For each such template, the username is substituted and the DN is generated. Each generated DN is tried by the MinIO server to login to LDAP. If exactly one successful DN is found, it is used to perform the groups lookup as well. This mode is enabled by setting the following variables:Group membership search
MinIO can be configured to find the groups of a user from AD/LDAP by specifying the folllowing variables:Variable substitution in AD/LDAP configuration strings
In the configuration variables,%s is substituted with the username from the STS request and %d is substituted with the distinguished username (user DN) of the LDAP user. Please see the following table for which configuration variables support these substitution variables:
| Variable | Supported substitutions |
|---|---|
MINIO_IDENTITY_LDAP_USERNAME_FORMAT | %s |
MINIO_IDENTITY_LDAP_USER_DN_SEARCH_FILTER | %s |
MINIO_IDENTITY_LDAP_GROUP_SEARCH_FILTER | %s and %d |
Managing User/Group Access Policy
Access policies may be configured on a group or on a user directly. Access policies are first defined on the MinIO server using IAM policy JSON syntax. Themc tool is used to issue the necessary commands.
Note that by default no policy is set on a user. Thus even if they successfully authenticate with AD/LDAP credentials, they have no access to object storage as the default access policy is to deny all access.
To define a new policy, you can use the AWS policy generator. Copy the policy into a text file mypolicy.json and issue the command like so:
mc admin user or mc admin group commands except mc admin user info and mc admin group info to list set policies for users and groups. This is because users and groups are defined externally in AD/LDAP.
API Request Parameters
LDAPUsername
Is AD/LDAP username to login. Application must ask user for this value to successfully obtain rotating access credentials from AssumeRoleWithLDAPIdentity.| Params | Value |
|---|---|
| Type | String |
| Length Constraints | Minimum length of 2. Maximum length of 2048. |
| Required | Yes |
LDAPPassword
Is AD/LDAP username password to login. Application must ask user for this value to successfully obtain rotating access credentials from AssumeRoleWithLDAPIdentity.| Params | Value |
|---|---|
| Type | String |
| Length Constraints | Minimum length of 4. Maximum length of 2048. |
| Required | Yes |
Version
Indicates STS API version information, the only supported value is ‘2011-06-15’. This value is borrowed from AWS STS API documentation for compatibility reasons.| Params | Value |
|---|---|
| Type | String |
| Required | Yes |
Policy
An IAM policy in JSON format that you want to use as an inline session policy. This parameter is optional. Passing policies to this operation returns new temporary credentials. The resulting session’s permissions are the intersection of the canned policy name and the policy set here. You cannot use this policy to grant more permissions than those allowed by the canned policy name being assumed.| Params | Value |
|---|---|
| Type | String |
| Valid Range | Minimum length of 1. Maximum length of 2048. |
| Required | No |
