iTranslated by AI
Trying Out LLDAP, a Lightweight LDAP Server
About LLDAP
LDAP is a protocol for efficiently querying users managed on a server, and applications or software with functionality to centrally manage users and organizations using this protocol are called LDAP servers.
There are several types of LDAP servers depending on their features and characteristics. Representative open-source options include the following:
- OpenLDAP
- FreeIPA
- 389 Directory Server
- Kanidm
- LLDAP
The most famous among these is OpenLDAP, which has the following pros and cons:
- Pros
- Feature-rich with high customizability for unique functions
- Information is relatively abundant
- Environment setup is easy since container images and Helm charts exist
- Configs such as schemas may be required in some cases
- Cons
- High learning cost to learn from scratch
- Plenty of information, but few consolidated documents
- No built-in UI. There are several options, but all of them feel legacy
On the other hand, Light LDAP (LLDAP), which we are trying this time, offers the following advantages:
- Implemented in Rust and lightweight
- No need for configs like schemas
- Simple but includes a built-in UI.
- Simple, as the LDAP elements that can be created are limited to users and groups. Conversely, there are fewer items for users to think about.
As the name Light LDAP suggests, it is basically positioned as an easy-to-use LDAP server. You can also refer to the comparison with other LDAP servers on GitHub.
So, let's try it out right away.
Environment Setup
You can easily set it up using the docker-compose example in the With Docker section on GitHub.
The configuration items are as follows:
- LDAP_BASE_DN
- In this verification, I want to set the LLDAP hostname to
ldap.centre.com, so accordingly,LDAP_BASE_DNis set todc=ldap,dc=centre,dc=com.
- In this verification, I want to set the LLDAP hostname to
- port
- 3890 is used for LDAP.
- 6360 is used for LDAPS (unused this time).
- 17170 is used for the web UI.
- LLDAP_VERBOSE=true
- Corresponds to the log level. Set to true for debug logs.
services:
lldap:
image: lldap/lldap:stable
container_name: lldap
restart: always
ports:
- "3890:3890"
- "6360:6360"
- "17170:17170"
volumes:
- "./lldap_data:/data"
environment:
- LLDAP_VERBOSE=true
- LLDAP_JWT_SECRET=REPLACE_WITH_RANDOM
- LLDAP_KEY_SEED=REPLACE_WITH_RANDOM
- LLDAP_LDAP_BASE_DN=dc=ldap,dc=centre,dc=com
Operation Check
After starting the container, you can access the web UI at 0.0.0.0:17170.
You can log in with the initial user: username: admin, password: password.
The web UI has a very simple design, displaying lists of created users/groups in the users/groups tabs and allowing new ones to be created with their respective create buttons.

As a test, let's create a test user and group.


You can search for registered information using the ldapsearch command, which is used to search LDAP information. Let's check the contents of the user and group we created.
$ ldapsearch -x -b "dc=ldap,dc=centre,dc=com" -D "uid=admin,ou=people,dc=ldap,dc=centre,dc=com" -w password -H ldap://0.0.0.0:3890
# test-lldap, people, ldap.centre.com
dn: uid=test-lldap,ou=people,dc=ldap,dc=centre,dc=com
objectclass: inetOrgPerson
objectclass: posixAccount
objectclass: mailAccount
objectclass: person
uid: test-lldap
mail: test-lldap@example.com
givenname: test
sn: lldap
cn: test-lldap
createtimestamp: 2024-04-17T09:49:03.158678344+00:00
entryuuid: e5eaf923-9c83-3e1a-8594-7c3ac65b2b8d
# test-lldp-group, groups, ldap.centre.com
dn: cn=test-lldp-group,ou=groups,dc=ldap,dc=centre,dc=com
objectclass: groupOfUniqueNames
uid: test-lldp-group
cn: test-lldp-group
entryuuid: 6e1dcd5f-f195-3957-9b15-07a2599a792b
You can see that users are set in ou=people and groups in ou=groups, with other attributes such as objectClass added automatically.
Operations via CLI
In addition to adding users and groups via the web UI, the following methods are currently available for creating and managing users:
- GraphQL
- CLI (shell script)
Details can be found here:
CLI
Regarding the CLI, you can add or reference users from the CLI using lldap-cli found in the following repository:
The background and process of its introduction seem to be documented in https://github.com/lldap/lldap/issues/707.
As you can see from the contents of the shell script, it executes GraphQL queries internally, so it is effectively the same as adding users via GraphQL.
While installing the required packages specified in the Requirements is necessary, since it's a single-file shell script, you can use it by copying and pasting it locally. You can also register users and groups in bulk by preparing a simple Python script to call the CLI.
For example, prepare a Python script that calls the following processes using subprocess:
- User registration
- Group registration
- Adding users to groups
- Password setting
import subprocess
import sys
from ruamel.yaml import YAML
env = {
"LLDAP_HTTPURL": "http://0.0.0.0:17170",
"LLDAP_USERNAME": "admin",
"LLDAP_PASSWORD": "password",
}
def create_group(group: str):
cmd = f"./lldap-cli group add {group}"
subprocess.run(cmd.split(), env=env)
def create_user(uid, email, display_name, first_name, last_name):
cmd = f"./lldap-cli user add {uid} {email} -d {display_name} -f {first_name} -l {last_name}"
subprocess.run(
cmd.split(),
env=env,
)
def add_user_to_group(uid, group):
cmd = f"./lldap-cli user group add {uid} {group}"
subprocess.run(
cmd.split(),
env=env,
)
def set_user_password(uid, password):
cmd = f"docker exec -it lldap /app/lldap_set_password --username {uid} --password {password} --admin-username {env['LLDAP_USERNAME']} --admin-password {env['LLDAP_PASSWORD']} --base-url {env['LLDAP_HTTPURL']}"
subprocess.run(
cmd.split(),
env=env,
)
if __name__ == "__main__":
with open("ldap.yml") as f:
yaml = YAML().load(f)
groups = yaml["groups"]
users = yaml["users"]
for g in groups:
create_group(g)
for u in users:
uid = u["uid"]
email = u["email"]
password = u["password"]
display_name = u["display_name"]
first_name = u["first_name"]
last_name = u["last_name"]
groups = u["groups"]
create_user(uid, email, display_name, first_name, last_name)
set_user_password(uid, password)
for g in groups:
add_user_to_group(uid, g)
Define the groups and users to be registered in bulk in a YAML file.
groups:
- group1
- group2
users:
- uid: user1
email: user1@test.com
password: user1password
display_name: user1
first_name: user
last_name: one
groups:
- group1
- uid: user2
email: user2@test.com
password: user2password
display_name: user2
first_name: user
last_name: two
groups:
- group1
- group2
You can register users and groups in bulk by running main.py.
$ python3 main.py
Created group: group1
Created group: group2
Created user: user1
Successfully changed user1's password
{"data":{"addUserToGroup":{"ok":true}}}
Created user: user2
Successfully changed user2's password
{"data":{"addUserToGroup":{"ok":true}}}
{"data":{"addUserToGroup":{"ok":true}}}
About User Password Updates
The CLI describes a process to update the passwords of registered users using the lldap_set_password function, but as of the time of writing this article, the corresponding process or GraphQL has not been implemented. Therefore, it is currently impossible to set a password during new user creation or update the password of an existing user through those means.
On the other hand, as seen in this issue, the password update process is already implemented in the Rust source code and is placed as an executable file at /app/lldap_set_password within the image.
$ docker exec -it lldap ls -l /app/
total 43260
drwxr-xr-x 4 lldap lldap 4096 Sep 14 2023 app
-rwxr-xr-x 1 lldap lldap 27302672 Sep 14 2023 lldap
-rw-r--r-- 1 lldap lldap 6086 Sep 14 2023 lldap_config.docker_template.toml
-rwxr-xr-x 1 lldap lldap 9253272 Sep 14 2023 lldap_migration_tool
-rwxr-xr-x 1 lldap lldap 7721472 Sep 14 2023 lldap_set_password
The source code is at https://github.com/lldap/lldap/tree/main/set-password.
So, you can update a user's password by executing the above command inside the container. For example, to set the password for user1 to user1password, use the following:
$ docker exec -it lldap /app/lldap_set_password --username user1 --password user1password --admin-username admin --admin-password password --base-url http://0.0.0.0:17170
Successfully changed user1's password
You can verify that it has been updated correctly by executing the login API with the updated user/password and obtaining a token.
$ curl http://0.0.0.0:17170/auth/simple/login -H "content-type: application/json" -d '{"username": "user1", "password": "user1password"}'
{"token":"eyJh.....}
GraphQL
When using GraphQL, you can create users and reference registered data based on the schema defined in https://github.com/lldap/lldap/blob/main/schema.graphql.
To use GraphQL from the CLI, authentication is performed via a token, so you must first log in to obtain one.
$ curl http://0.0.0.0:17170/auth/simple/login -H "content-type: application/json" -d '{"username": "admin", "password": "password"}'
{"token":"eyJhbGciOiJIUzUxMiJ9.eyJleHAiOiIyMDI0LTA5LTA0VDE3OjMwOjU2LjA0ODA1ODk4MloiLCJpYXQiOiIyMDI0LTA5LTAzVDE3OjMwOjU2LjA0ODA1OTIzMloiLCJ1c2VyIjoiYWRtaW4iLCJncm91cHMiOlsibGxkYXBfYWRtaW4iXX0.zfbjGvVr6oCN1_c9xxJs0ApWTeyloZ_FytrFclt9GilYnI8KE2wEsoNaxd6ZHdl8HuOS4FnDvw8Ic3uono-j3w","refreshToken":"4pLFkAORFTtAfb57pZUVp5PRfRCSop04u3xtXkC7rNAUk3yQnEAYiFkzcCg0H1WJxxG3N59JHqX82WESiHvrvNE8Y6UHJk8nzmsh+admin"}%
Afterward, by setting Authorization: Bearer ${token} in the request header, authentication will succeed, and queries can be executed.
When executing a query, send a request to http://[url]/api/graphql.
token="eyJhbGciOiJIUzUxMiJ9.eyJleHAiOiIyMDI0LTA5LTA0VDE3OjMwOjU2LjA0ODA1ODk4MloiLCJpYXQiOiIyMDI0LTA5LTAzVDE3OjMwOjU2LjA0ODA1OTIzMloiLCJ1c2VyIjoiYWRtaW4iLCJncm91cHMiOlsibGxkYXBfYWRtaW4iXX0.zfbjGvVr6oCN1_c9xxJs0ApWTeyloZ_FytrFclt9GilYnI8KE2wEsoNaxd6ZHdl8HuOS4FnDvw8Ic3uono-j3w"
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${token}" \
-d '{"query": user(userId:"admin") {displayName}}' \
http://0.0.0.0:17170/api/graphql
Example of registering a group:
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer ${token}" \
-d '{"query": "mutation { createGroup (name: \"group2\") {displayName} }" }' \
http://0.0.0.0:17170/api/graphql | jq
Playground
Accessing http://0.0.0.0:17170/api/graphql/playground in your browser opens the GraphQL Playground, where you can execute GraphQL queries directly.
As with the CLI, the token must be set in the header. For more details, see https://github.com/lldap/lldap/blob/main/docs/scripting.md.
Example of creating a user:
mutation{
createUser(user: {
id: "test1"
email: "test1@test.com"
displayName: "test1"
firstName: "test"
lastName: "one"
}
) {
displayName
email
id
firstName
lastName
}
}
Use Cases
Since just this is a bit boring, let's try integrating it with other services I've used before.
Authelia
Many large-scale OSS projects that have a concept of user management implement LDAP integration, allowing for centralized management of users and groups via an LDAP server. For example, Authelia, which I covered in a previous article, has built-in integration with LLDAP by default, so I'll give that a try.
Configuration examples are provided in the LLDAP GitHub and Authelia Integration docs. Although the configuration items differ slightly between them, I found that the example from Authelia's side worked well.
In Authelia's configuration.yml file, you set up the LDAP server connection settings and filters for detecting users and groups.
authentication_backend:
#file:
# path: '/config/users_database.yml'
#refresh_interval: 1m
ldap:
implementation: custom
address: ldap://ldap.centre.com:3890
timeout: 5s
start_tls: false
base_dn: "dc=ldap,dc=centre,dc=com"
users_filter: "(&({username_attribute}={input})(objectClass=person))"
additional_users_dn: "ou=people"
additional_groups_dn: "ou=groups"
attributes:
username: "uid"
display_name: 'displayName'
mail: 'mail'
group_name: 'cn'
member_of: 'memberOf'
distinguished_name: 'distinguishedName'
groups_filter: "(member={dn})"
user: "uid=admin,ou=people,dc=ldap,dc=centre,dc=com"
password: 'password'
No additional configuration is required on the LLDAP side.
After restarting the Authelia container, access auth.example.com, and you will be able to log in with the test-lldap user created earlier. This allows the user and group information, which was managed in a file in the previous article, to be centrally managed on the LDAP side. Of course, this user can also be used for single sign-on to other services like Gitea.
Role Mapping (Grafana)
Some OSS projects with user management concepts use specific roles to perform access control. For example, Grafana, well-known for monitoring, has three roles: Admin, Editor, and Viewer, and accessible resources are restricted based on these roles.
In such applications, some support functionality to map users to specific roles during registration based on groups or organizations on the LDAP side. In Grafana, this is available as role mapping, allowing roles to be assigned based on the name of the group the user belongs to. Let's try this out as well.
First, create the following groups in LLDAP corresponding to Grafana's Admin, Editor, and Viewer roles, then create users corresponding to each group and add them to those groups.
| group | user |
|---|---|
| grafana_admin | common_admin |
| grafana_editor | common_developer |
| grafana_viewer | test_lldap |
Authelia has an OIDC integration example with Grafana, so I will write the client configuration based on that.
identity_providers:
oidc:
jwks:
- key_id: "authelia"
algorithm: "RS256"
use: "sig"
key: |
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
clients:
- client_id: 'grafana'
client_name: 'grafana'
client_secret: '$pbkdf2-sha512$310000$vdSjQwKQ/ohm9ikh04bE8g$SuJdRpgPRCdLJSQzgWGctv2LE5/XVR6YCSA6ARUNhRHa8N7X4wJJnBwEp4B0ir9vJTKyeksYyOfWTQHjg7b2yQ'
public: false
authorization_policy: 'one_factor'
redirect_uris:
- 'https://grafana.centre.com:3100/login/generic_oauth'
scopes:
- "openid"
- "profile"
- "groups"
- "email"
require_pkce: true
pkce_challenge_method: 'S256'
userinfo_signed_response_alg: 'none'
token_endpoint_auth_method: 'client_secret_basic'
Next, prepare a docker-compose.yml for building Grafana with Docker.
services:
grafana:
image: grafana/grafana:latest
container_name: grafana
restart: always
ports:
- '3100:3100'
volumes:
- ./data:/var/lib/grafana'
- ./grafana.ini:/etc/grafana/grafana.ini
- ./grafana.centre.com.crt:/usr/share/grafana/grafana.centre.com.crt
- ./grafana.centre.com.key:/usr/share/grafana/grafana.centre.com.key
extra_hosts:
- "auth.example.com:192.168.3.18"
Grafana uses the grafana.ini file for settings, so include the Authelia OIDC configuration there. Since there are no Authelia-specific settings, fill in each item while referring to the Set up OAuth2 with Auth0 configuration.
Regarding role mapping, specify a filter for role_attribute_path to map roles based on the LDAP group names as follows:
- If the user belongs to a group containing
admin, assign the Admin role. - If the user belongs to a group containing
editor, assign the Editor role. - Otherwise, assign the Viewer role.
[server]
protocol = https
http_port = 3100
domain = grafana.centre.com
root_url = %(protocol)s://%(domain)s:%(http_port)s/
cert_file = /usr/share/grafana/grafana.centre.com.crt
cert_key = /usr/share/grafana/grafana.centre.com.key
[security]
cookie_secure = true
[auth.generic_oauth]
enabled = true
name = Authelia
client_id = grafana
client_secret = grafana
scopes = openid profile email groups
empty_scopes = false
auth_url = https://auth.example.com/api/oidc/authorization
token_url = https://auth.example.com/api/oidc/token
api_url = https://auth.example.com/api/oidc/userinfo
role_attribute_path = (groups[?contains(@, 'admin') == `true`]) && 'Admin' || (groups[?contains(@, 'editor') == `true`]) && 'Editor' || 'Viewer'
role_attribute_strict = true
login_attribute_path = preferred_username
groups_attribute_path = groups
name_attribute_path = name
use_pkce = true
How to decide the filter
Grafana's role_attribute_path is evaluated based on the fields within the payload passed from Authelia to Grafana during user SSO. You can check the contents of the payload passed by Authelia using the following method (I am not sure if this is the official way).
First, start Grafana with its log level set to debug without specifying role_attribute_path, and perform SSO using Authelia. At this point, even if authentication is successful, the user won't be mapped to a role, but you can search the Grafana logs for a message like Received id_token" raw_json.
logger=oauth.generic_oauth t=2024-04-16T16:30:04.990564104Z level=debug msg="Received id_token" raw_json="{"amr":["pwd"],"at_hash":"SuINR-_ghnlLcCsa6bcACw","aud":["grafana"],"auth_time":1713285001,"azp":"grafana","client_id":"grafana","email":"common_developer@example.com","email_verified":true,"exp":1713288604,"groups":["grafana_editor"],"iat":1713285004,"iss":"https://auth.example.com","jti":"afca52d5-06b0-488e-b77d-304eda66f607","name":"common_developer","preferred_username":"common_developer","rat":1713285001,"sub":"0abcf543-4a0c-4055-8909-fd05c2934199"}" data="Name: common_developer, Displayname: , Login: , Username: , Email: common_developer@example.com, Upn: , Attributes: map[]"
The raw_json inside this corresponds to the payload. Here is the formatted JSON:
{
"amr": [
"pwd"
],
"at_hash": "SuINR-_ghnlLcCsa6bcACw",
"aud": [
"grafana"
],
"auth_time": 1713285001,
"azp": "grafana",
"client_id": "grafana",
"email": "common_developer@example.com",
"email_verified": true,
"exp": 1713288604,
"groups": [
"grafana_editor"
],
"iat": 1713285004,
"iss": "https://auth.example.com",
"jti": "afca52d5-06b0-488e-b77d-304eda66f607",
"name": "common_developer",
"preferred_username": "common_developer",
"rat": 1713285001,
"sub": "0abcf543-4a0c-4055-8909-fd05c2934199"
}
From this, you can see that there is a groups field at the top level, and under it, the groups the user belongs to (LLDAP-side groups) are set as a list. All you have to do is create an expression that matches this condition while referring to the JMESPath syntax. The expression that satisfies the condition to map these groups to roles is as follows:
role_attribute_path = (groups[?contains(@, 'admin') == `true`]) && 'Admin' || (groups[?contains(@, 'editor') == `true`]) && 'Editor' || 'Viewer'
When you access the Grafana web UI at grafana.centre.com:3100, a "Sign in with Authelia" button for SSO is added in addition to the normal user/password login. Clicking this redirects you to Authelia, just like with Gitea, and you can log in to Grafana using your LDAP user information.

When you log in with the common_admin, common_developer, and test_lldap users respectively, the LDAP username and email address information are registered in Grafana. By logging in with the initial admin user and checking Administration > Users and access > Users > Organization users, you can verify that each user is registered and that roles have been mapped based on their groups as expected.

As we saw in the previous article, Authelia allows for access control based on user groups, but in applications that support Role Mapping, you can also manage user permissions via the application's own roles. Which one is better to use depends on the scale of users and groups in LDAP and your operation policy, but using roles might make management easier as it saves the effort of setting up access control one by one.
Integration with Vault
Vault, the secret management tool introduced in a previous article, can also be integrated with LDAP. There are mainly two types of LDAP integration.
- Using LDAP user information for Vault authentication.
- Managing (rotating) passwords of users created in LDAP using Vault.
Regarding the first one, it involves using the LDAP auth method. For more details, refer to the HashiCorp Japanese workshop.
The second one uses the LDAP Secret Engine to periodically rotate the passwords of users created in LDAP, thereby reducing the risk of leakage. There is a tutorial below, so let's try it out.
Prepare a docker-compose.yml to start Vault in dev mode for verification.
services:
vault:
container_name: vault
image: hashicorp/vault
ports:
- 8200:8200
cap_add:
- IPC_LOCK
command: server -dev -dev-root-token-id="00000000-0000-0000-0000-000000000000"
extra_hosts:
- "ldap.centre.com:192.168.3.18"
environment:
VAULT_DEV_ROOT_TOKEN_ID: '00000000-0000-0000-0000-000000000000'
VAULT_TOKEN: "0"
Configure the connection destination for the Vault CLI.
export VAULT_ADDR="http://192.168.3.18:8200"
export VAULT_TOKEN="00000000-0000-0000-0000-000000000000"
The documentation describes setting various policies, but since we are connecting with a root token this time, they are not necessary. For other authentication methods, they must be configured appropriately.
First, enable the LDAP secret engine.
$ vault secrets enable ldap
Success! Enabled the ldap secrets engine at: ldap/
Specify the DN and password of the initial LDAP user, admin, for the binddn.
$ vault write ldap/config \
binddn=uid=admin,ou=people,dc=ldap,dc=centre,dc=com \
bindpass=password \
url=ldap://192.168.3.18:3890
Success! Data written to: ldap/config
Map the LDAP user to be rotated with a Vault role. Here, the target user is test-lldap, and the role name is test_lldap_role. rotation_period is the password rotation interval. We'll set it to 1 minute for verification.
$ vault write ldap/static-role/test-lldap-role \
dn='uid=test-lldap,ou=people,dc=ldap,dc=centre,dc=com' \
username='test-lldap' \
rotation_period="1m"
Success! Data written to: ldap/static-role/test-lldap-role
Now the setup is complete, and the password for test-lldap will automatically rotate every minute.
To obtain the password for logging in as this user, execute vault read ldap/static-cred/test-lldap-role.
$ vault read ldap/static-cred/test-lldap-role
Key Value
--- -----
dn uid=test-lldap,ou=people,dc=ldap,dc=centre,dc=com
last_password n/a
last_vault_rotation 2024-04-17T16:37:34.796780852Z
password LBWXDoW4QlbUbvGEKzo7xIotnh9bilEkaRQmhEaNxlONWJMd5N1yPF58g2kbFoej
rotation_period 1m
ttl 2s
username test-lldap
The password in the return value is the temporary password. If you specify this user and password for the bind in ldapsearch and execute it, you can confirm that the login is successful because search results are returned.
$ ldapsearch -x -b "dc=ldap,dc=centre,dc=com" -D "uid=test-lldap,ou=people,dc=ldap,dc=centre,dc=com" -w LBWXDoW4QlbUbvGEKzo7xIotnh9bilEkaRQmhEaNxlONWJMd5N1yPF58g2kbFoej -H ldap://0.0.0.0:3890
...
# search result
search: 2
result: 0 Success
# numResponses: 3
# numEntries: 2
Since the password's expiration is equal to the rotation_period (= 1 minute), if you run the same command after some time, authentication will fail.
$ ldapsearch -x -b "dc=ldap,dc=centre,dc=com" -D "uid=test-lldap,ou=people,dc=ldap,dc=centre,dc=com" -w LBWXDoW4QlbUbvGEKzo7xIotnh9bilEkaRQmhEaNxlONWJMd5N1yPF58g2kbFoej -H ldap://0.0.0.0:3890
ldap_bind: Invalid credentials (49)
Internally, it connects to the LDAP server every rotation_period using the bind user specified in ldap/config and updates the target user's password. You can check this request by enabling verbose logs in LLDAP and tracing them.
INFO LDAP session [ 166ms | 0.04% / 100.00% ]
INFO ┝━ LDAP request [ 90.7ms | 0.10% / 54.54% ]
DEBUG │ ┝━ 🐛 [debug]: | msg: LdapMsg { msgid: 1, op: BindRequest(LdapBindRequest { dn: "uid=admin,ou=people,dc=ldap,dc=centre,dc=com", cred: LdapBindCred::Simple }), ctrl: [] }
DEBUG │ ┝━ do_bind [ 90.6ms | 0.04% / 54.44% ] dn: uid=admin,ou=people,dc=ldap,dc=centre,dc=com # Binding with the bind user (=admin) set in ldap/config
DEBUG │ │ ┝━ bind [ 90.3ms | 0.01% / 54.31% ]
...
DEBUG │ │ ┕━ 🐛 [debug]: Success!
DEBUG │ ┕━ 🐛 [debug]: | response: BindResponse(LdapBindResponse { res: LdapResult { code: Success, matcheddn: "", message: "", referral: [] }, saslcreds: None })
INFO ┕━ LDAP request [ 75.6ms | 45.22% / 45.42% ]
DEBUG ┝━ 🐛 [debug]: | msg: LdapMsg { msgid: 2, op: ModifyRequest(LdapModifyRequest { dn: "uid=test-lldap,ou=people,dc=ldap,dc=centre,dc=com", changes: [LdapModify { operation: Replace, modification: LdapPartialAttribute { atype: "userPassword", vals: ["********"] } }] }), ctrl: [] } # Request to update the password (userPassword) for test-lldap
DEBUG ┝━ get_user_groups [ 137µs | 0.08% ] user_id: "test-lldap"
DEBUG │ ┕━ 🐛 [debug]: | return: {GroupDetails { group_id: GroupId(10), display_name: "grafana_viewer", creation_date: 2024-04-17T14:31:56.051949721, uuid: Uuid("60b422cc-657a-3762-a93a-6942a61a8785"), attributes: [] }}
DEBUG ┝━ registration_start [ 54.3µs | 0.03% ]
DEBUG ┝━ registration_finish [ 137µs | 0.08% ]
DEBUG ┕━ 🐛 [debug]: | response: ModifyResponse(LdapResult { code: Success, matcheddn: "", message: "", referral: [] }) # Request completed
That's how the LDAP Secret Engine rotates LDAP user passwords. To be honest, it's quite a hassle to repeatedly run vault read ldap/static-cred/test-lldap-role and log in for users in development environments, so for frequently used users, it might not be necessary to manage things that strictly (assuming passwords are managed properly). However, in environments where security is critical, such as production, setting an appropriate rotation_period to rotate passwords and lower the risk of leakage seems very useful.
Conclusion
I've confirmed how LLDAP works in integration with OIDC and other services.
The setup is easy and users/groups can be added simply via the UI, so it seems to have sufficient functionality as long as it's not a very large-scale environment or requires complex operations. On the other hand, you cannot arbitrarily set LDAP OUs, configure nested OU structures, or specify custom attributes for users and groups, so for use cases where those are necessary, you'll need to consider using other LDAP servers.
Also, the learning cost is low as the necessary information is compactly summarized. For example, OpenLDAP's documentation can feel legacy and difficult to dive into from a modern perspective, but LLDAP only requires reading the GitHub README (and perhaps the config file settings), making it easy to set up and use immediately. It's recommended for those who want to try things out quickly without needing to master everything for production-level operations.
Discussion